}
+static
+NET_API_STATUS
+DisplayLocalGroup(LPWSTR lpGroupName)
+{
+ PLOCALGROUP_INFO_1 pGroupInfo = NULL;
+ PLOCALGROUP_MEMBERS_INFO_3 pMembers = NULL;
+ PSERVER_INFO_100 pServer = NULL;
+ LPWSTR *pNames = NULL;
+ DWORD dwRead = 0;
+ DWORD dwTotal = 0;
+ DWORD_PTR ResumeHandle = 0;
+ DWORD i;
+ DWORD len;
+ NET_API_STATUS Status;
+
+ Status = NetLocalGroupGetInfo(NULL,
+ lpGroupName,
+ 1,
+ (LPBYTE*)&pGroupInfo);
+ if (Status != NERR_Success)
+ return Status;
+
+ Status = NetLocalGroupGetMembers(NULL,
+ lpGroupName,
+ 3,
+ (LPBYTE*)&pMembers,
+ MAX_PREFERRED_LENGTH,
+ &dwRead,
+ &dwTotal,
+ &ResumeHandle);
+ if (Status != NERR_Success)
+ goto done;
+
+ Status = NetServerGetInfo(NULL,
+ 100,
+ (LPBYTE*)&pServer);
+ if (Status != NERR_Success)
+ goto done;
+
+ pNames = RtlAllocateHeap(RtlGetProcessHeap(),
+ HEAP_ZERO_MEMORY,
+ dwRead * sizeof(LPWSTR));
+ if (pNames == NULL)
+ {
+ Status = ERROR_OUTOFMEMORY;
+ goto done;
+ }
+
+ len = wcslen(pServer->sv100_name);
+ for (i = 0; i < dwRead; i++)
+ {
+ if (!wcsncmp(pMembers[i].lgrmi3_domainandname, pServer->sv100_name, len))
+ pNames[i] = &pMembers[i].lgrmi3_domainandname[len + 1];
+ else
+ pNames[i] = pMembers[i].lgrmi3_domainandname;
+ }
+
+ printf("Alias name %S\n", pGroupInfo->lgrpi1_name);
+ printf("Comment %S\n", pGroupInfo->lgrpi1_comment);
+ printf("\n");
+ printf("Members\n");
+ printf("\n");
+ printf("------------------------------------------\n");
+
+ for (i = 0; i < dwRead; i++)
+ {
+ if (pNames[i])
+ printf("%S\n", pNames[i]);
+ }
+
+done:
+ if (pNames != NULL)
+ RtlFreeHeap(RtlGetProcessHeap(), 0, pNames);
+
+ if (pServer != NULL)
+ NetApiBufferFree(pServer);
+
+ if (pMembers != NULL)
+ NetApiBufferFree(pMembers);
+
+ if (pGroupInfo != NULL)
+ NetApiBufferFree(pGroupInfo);
+
+ return Status;
+}
+
+
INT
cmdLocalGroup(
INT argc,
printf("Status: %lu\n", Status);
return 0;
}
+ else if (argc == 3)
+ {
+ Status = DisplayLocalGroup(argv[2]);
+ printf("Status: %lu\n", Status);
+ return 0;
+ }
i = 2;
if (argv[i][0] != L'/')
Version = 2.9.3.5\r
Licence = Freeware\r
Description = Abyss Web Server enables you to host your Web sites on your computer. It supports secure SSL/TLS connections (HTTPS) as well as a wide range of Web technologies. It can also run advanced PHP, Perl, Python, ASP, ASP.NET, and Ruby on Rails Web applications, which can be backed by databases such as MySQL, SQLite, MS SQL Server, MS Access, or Oracle.\r
-Size = 2.1 MB\r
+Size = 2.06 MB\r
Category = 5\r
URLSite = http://www.aprelium.com/\r
URLDownload = http://www.aprelium.com/data/abwsx1.exe\r
\r
[Section.040c]\r
Description = Abyss Web Server vous permet d'héberger vos sites internet sur votre ordinateur. Il supporte les connexions sécurisées SSL/TLS (HTTPS) ainsi qu'un grand nombre de technologies web. Il peut également faire tourner des applications web PHP, Perl, Python, ASP, ASP.Net, Ruby et Ruby on Rails, qui peuvent être associées à des bases de données telles que MySQL, SQLite, MS SQL Server, MS Access ou Oracle.\r
-Size = 2,1 Mo\r
+Size = 2,06 Mo\r
\r
[Section.0410]\r
Description = Abyss Web Server consente di ospitare i vostri siti Web sul computer. Supporta connessioni sicure SSL / TLS (HTTPS), così come una vasta gamma di tecnologie web. E' inoltre possibile eseguire avanzato PHP, Perl, Python, ASP, ASP.NET, e Ruby on Rails, applicazioni Web che possono essere supportate da database come MySQL, SQLite, MS SQL Server, MS Access, o Oracle.\r
[Section.0418]\r
Licence = Gratuită\r
Description = Abyss Web Server vă permite găzduirea de pagini Web pe calculatorul dumneavoastră. Oferă conexiuni securizate SSL/TLS (HTTPS) și multe alte tehnologii Web. Poate executa aplicații Web avansate ]n PHP, Perl, Python, ASP, ASP.NET și Ruby on Rails, ce pot fi susținute de baze de date ca MySQL, SQLite, MS SQL Server, MS Access, sau Oracle.\r
-Size = 2,1 Mo\r
+Size = 2,06 Mo\r
\r
[Section.041f]\r
Name = Abyss Umûmî Ağ Sunucusu X1\r
Licence = Ücretsiz\r
Description = Abyss Umûmî Ağ Sunucusu, bilgisayarınızda Umûmî Ağ sitelerinizin barındırılmasına olanak sağlar. Umûmî Ağ uygulayım biliminin bir geniş yelpâzesiyle birlikte güvenli SSL/TLS bağlantılarını (HTTPS) destekler. Ayrıca MySQL, SQLite, MS SQL Server, MS Access, ve Oracle gibi veri tabanlarıyla desteklenebilen gelişmiş PHP, Perl, Python, ASP, ASP.NET ve Rails üzerinde Ruby Umûmî Ağ uygulamalarını çalıştırabilir.\r
-Size = 2,1 MB\r
+Size = 2,06 MB\r
\r
[Section.0422]\r
Description = Abyss Web Server дозволить вам утримувати веб-сайти на вашому комп'ютері. Від підтримує безпечні SSL/TLS з'єднання (HTTPS) та великий ряд веб-технологій. Він також запускає PHP, Perl, Python, ASP, ASP.NET, та Ruby on Rails веб-додатки, які можуть підтримуватись такими базами даних, як MySQL, SQLite, MS SQL Server, MS Access, чи Oracle.\r
Name = AlReader
Description = A FB2 eBook Reader. Supported 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
+Size = 4.56 MB
Category = 6
URLDownload = http://svn.reactos.org/packages/AlReader2Setup.exe
CDPath = none
[Section.0418]
Description = Un cititor de cărți electronice. Poate citi fișiere de tip: fb2, fbz, txt, epub, html, doc, docx, odt, rtf, mobi, prc (PalmDoc), tcr. Include suport pentru arhive ZIP și GZ.
-Size = 4,6 Mo
+Size = 4,56 Mo
[Section.041f]
Description = Bir FB2 elektronik kitap okuyucusu. Desteklenen okuma biçimleri: fb2, fbz, txt, epub, html, doc, docx, odt, rtf, mobi, prc (PalmDoc), tcr. ZIP ve GZ belgeliklerini destekler.
-Size = 4,6 MB
+Size = 4,56 MB
+++ /dev/null
-; UTF-8
-; Polish translation by wojo664
-; Turkish translation by Erdem Ersoy (eersoy93) (erdemersoy@live.com)
-
-[Section]
-Name = Ants
-Version = N/A
-Licence = Freeware
-Description = A card strategic game. Build your own castle and try to destroy enemy castle. You need a ZIP decompression program to install it.
-Size = 632 kB
-Category = 4
-URLSite = http://peter.hostuju.cz/
-URLDownload = http://petr.hostuju.cz/program/download/ANTS.zip
-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.0410]
-Description = Un gioco di carte strategico. Costruisci il tuo castello e prova a distruggere il castello nemico. Necessita di un programma di estrazione ZIP per essere installato.
-
-[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]
-Version = Yok
-Licence = Ücretsiz
-Description = Bir kartlarla izlem oyunu. Kendi kurganınızı yapınız ve rakip kaleyi yıkmaya çalışınız. Kurmak için bir ZIP çıkartma izlencesi gerekir.
-Size = 632 KB
Version = 1.83 SE\r
Licence = Freeware\r
Description = A very good CD Ripper/Audio File Converter.\r
-Size = 4.35 MB\r
+Size = 3.43 MB\r
Category = 1\r
URLSite = http://www.audiograbber.de/\r
-URLDownload = http://www.audiograbber.de/files/4898276276/agsetup183se.exe\r
+URLDownload = http://ftp.freenet.de/pub/filepilot/fpt/audio/bearbeitung/audiograbber/agsetup183se.exe\r
CDPath = none\r
\r
[Section.0407]\r
\r
[Section.040c]\r
Description = Un très bon extracteur de CD/convertisseur de fichier audio.\r
-Size = 4,35 Mo\r
+Size = 3,43 Mo\r
\r
[Section.0410]\r
Description = Un ottimo CD Ripper/Audio File Converter.\r
[Section.0418]\r
Licence = Gratuită\r
Description = Program de extragere conținuturi CD audio și de conversie a fișierelor de sunet.\r
-Size = 4,35 Mo\r
+Size = 3,43 Mo\r
\r
[Section.041f]\r
Licence = Ücretsiz\r
Description = Çok iyi bir CD ripleyicisi ve ses kütüğü dönüştürücüsü.\r
-Size = 4,35 MB\r
+Size = 3,43 MB\r
\r
[Section.0422]\r
Description = Чудовий CD Ріппер/Конвертер аудіо файлів.\r
Version = 7.9.2
Licence = Freeware for non-commercial uses
Description = The Original BitTorrent Client.
-Size = 1.9 MB
+Size = 1.61 MB
Category = 5
URLSite = http://www.bittorrent.com/
URLDownload = http://download-new.utorrent.com/endpoint/bittorrent/os/windows/track/stable/BitTorrent.exe
[Section.0418]
Licence = Gratuită pentru uz necomercial
Description = Originalul client BitTorrent.
-Size = 1,9 Mo
+Size = 1,61 Mo
[Section.041f]
Licence = Tecimlik olmayan kullanımlar için ücretsiz.
Description = Özgün BitTorrent istemcisi.
-Size = 1,9 MB
+Size = 1,61 MB
+++ /dev/null
-; UTF-8
-; Turkish translation by Erdem Ersoy (eersoy93) (erdemersoy@live.com)
-
-[Section]
-Name = Orwell Dev-C++ MinGW32
-Version = 5.7.1
-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://download.sourceforge.net/project/orwelldevcpp/Setup%20Releases/Dev-Cpp%205.7.1%20MinGW%204.8.1%20Setup.exe
-CDPath = none
-
-[Section.0407]
-Description = Eine gepflegte Version von Dev-C++. Der MinGW32 Compiler liegt bei.
-
-[Section.0410]
-Description = Una versione mantenuta di Dev-C++. Contiene il compilatore MinGW32.
-
-[Section.0418]
-Description = O versiune menținută a Dev-C++. Conține compilatorul MinGW32.
-Size = 60,2 Mo
-
-[Section.041f]
-Licence = GPL 2. sürüm
-Description = Dev-C++'nın sürdürülen bir sürümü. MinGW32 derleyicisi içerir.
-Size = 60,2 MB
[Section]
Name = Orwell Dev-C++ TDM GCC x64
-Version = 5.7.1
+Version = 5.8.0
Licence = GPLv2
Description = A maintained version of Dev-C++. It contains 64 bit TDM-GCC compiler.
Size = 44.7 MB
Category = 7
URLSite = http://orwelldevcpp.blogspot.com/
-URLDownload = http://download.sourceforge.net/project/orwelldevcpp/Setup%20Releases/Dev-Cpp%205.7.1%20TDM-GCC%20x64%204.8.1%20Setup.exe
+URLDownload = http://download.sourceforge.net/project/orwelldevcpp/Setup%20Releases/Dev-Cpp%205.8.0%20TDM-GCC%204.8.1%20Setup.exe
CDPath = none
[Section.0407]
[Section]
Name = Double Commander
-Version = 0.5.10 Beta
+Version = 0.5.11 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.6 MB
+Size = 8.0 MB
Category = 12
URLSite = http://doublecmd.sourceforge.net/
-URLDownload = http://download.sourceforge.net/project/doublecmd/DC%20for%20Windows%2032%20bit/Double%20Commander%200.5.10%20beta/doublecmd-0.5.10.i386-win32.exe
+URLDownload = http://download.sourceforge.net/project/doublecmd/DC%20for%20Windows%2032%20bit/Double%20Commander%200.5.11%20beta/doublecmd-0.5.11.i386-win32.exe
CDPath = none
[Section.0407]
[Section.0418]
Description = Double Commander este un gestionar (cu surse deschise) 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,6 Mo
+Size = 8,0 Mo
[Section.0419]
Description = Double Commander - это открытый двухпанельный файловый менеджер. Вам нужен 7-Zip или подобная утилита для его распаковки.
[Section.041f]
Version = 0.5.8 Gelişme
Description = Double Commander, yan yana iki bölmeli bir açık kaynak kütük yöneticisidir. Çıkartmak için 7-Zip ya da benzeri bir yazılım kullanmanız gerekir.
-Size = 7,6 MB
+Size = 8,0 MB
[Section.0422]
Description = Double Commander - це відкритий двопанельний файловий менеджер. Вам потрібен 7-Zip або подібна утиліта щоб розпакувати його.
; Turkish translation by Erdem Ersoy (eersoy93) (erdemersoy@live.com)
[Section]
-Name = Mozilla Firefox 32
-Version = 32.0.1
+Name = Mozilla Firefox 33
+Version = 33.0
Licence = MPL/GPL/LGPL
Description = The most popular and one of the best free Web Browsers out there.
-Size = 30.75 MB
+Size = 34.76 MB
Category = 5
URLSite = http://www.mozilla.org/en-US/
-URLDownload = http://ftp.mozilla.org/pub/mozilla.org/firefox/releases/32.0.1/win32/en-US/Firefox%20Setup%2032.0.1.exe
+URLDownload = http://ftp.mozilla.org/pub/mozilla.org/firefox/releases/33.0/win32/en-US/Firefox%20Setup%2033.0.exe
CDPath = none
[Section.0405]
Description = Nejpopulárnější a jeden z nejlepších svobodných webových prohlížečů.
-Size = 30.6 MB
+Size = 34.57 MB
URLSite = http://www.mozilla.org/cs/
-URLDownload = http://ftp.mozilla.org/pub/mozilla.org/firefox/releases/32.0.1/win32/cs/Firefox%20Setup%2032.0.1.exe
+URLDownload = http://ftp.mozilla.org/pub/mozilla.org/firefox/releases/33.0/win32/cs/Firefox%20Setup%2033.0.exe
[Section.0407]
Description = Der populärste und einer der besten freien Webbrowser.
-Size = 30.56 MB
+Size = 34.57 MB
URLSite = http://www.mozilla.org/de/
-URLDownload = http://ftp.mozilla.org/pub/mozilla.org/firefox/releases/32.0.1/win32/de/Firefox%20Setup%2032.0.1.exe
+URLDownload = http://ftp.mozilla.org/pub/mozilla.org/firefox/releases/33.0/win32/de/Firefox%20Setup%2033.0.exe
[Section.040a]
Description = El más popular y uno de los mejores navegadores web gratuitos que hay.
-Size = 30.5 MB
+Size = 34.5 MB
URLSite = http://www.mozilla.org/es-ES/
-URLDownload = http://ftp.mozilla.org/pub/mozilla.org/firefox/releases/32.0.1/win32/es-ES/Firefox%20Setup%2032.0.1.exe
+URLDownload = http://ftp.mozilla.org/pub/mozilla.org/firefox/releases/33.0/win32/es-ES/Firefox%20Setup%2033.0.exe
[Section.040c]
Description = Le navigateur web gratuit le plus populaire et l'un des meilleurs.
-Size = 30,85 Mo
+Size = 34,86 Mo
URLSite = http://www.mozilla.org/fr/
-URLDownload = http://ftp.mozilla.org/pub/mozilla.org/firefox/releases/32.0.1/win32/fr/Firefox%20Setup%2032.0.1.exe
+URLDownload = http://ftp.mozilla.org/pub/mozilla.org/firefox/releases/33.0/win32/fr/Firefox%20Setup%2033.0.exe
[Section.0410]
Description = Il più popolare e uno dei migliori web browser gratuiti.
-Size = 30.49 MB
+Size = 34.5 MB
URLSite = http://www.mozilla.org/it/
-URLDownload = http://ftp.mozilla.org/pub/mozilla.org/firefox/releases/32.0.1/win32/it/Firefox%20Setup%2032.0.1.exe
+URLDownload = http://ftp.mozilla.org/pub/mozilla.org/firefox/releases/33.0/win32/it/Firefox%20Setup%2033.0.exe
[Section.0413]
Description = De meest populaire en een van de beste gratis Web browsers.
-Size = 31.2 MB
+Size = 35.21 MB
URLSite = http://www.mozilla.org/nl/
-URLDownload = http://ftp.mozilla.org/pub/mozilla.org/firefox/releases/32.0.1/win32/nl/Firefox%20Setup%2032.0.1.exe
+URLDownload = http://ftp.mozilla.org/pub/mozilla.org/firefox/releases/33.0/win32/nl/Firefox%20Setup%2033.0.exe
[Section.0414]
Description = Mest populære og best også gratis nettleserene der ute.
-Size = 30.55 MB
-URLDownload = http://ftp.mozilla.org/pub/mozilla.org/firefox/releases/32.0.1/win32/nb-NO/Firefox%20Setup%2032.0.1.exe
+Size = 34.57 MB
+URLDownload = http://ftp.mozilla.org/pub/mozilla.org/firefox/releases/33.0/win32/nb-NO/Firefox%20Setup%2033.0.exe
[Section.0415]
Description = Najpopularniejsza i jedna z najlepszych darmowych przeglądarek internetowych.
-Size = 31.42 MB
+Size = 35.43 MB
URLSite = http://www.mozilla.org/pl/
-URLDownload = http://ftp.mozilla.org/pub/mozilla.org/firefox/releases/32.0.1/win32/pl/Firefox%20Setup%2032.0.1.exe
+URLDownload = http://ftp.mozilla.org/pub/mozilla.org/firefox/releases/33.0/win32/pl/Firefox%20Setup%2033.0.exe
[Section.0418]
Description = Cel mai popular și unul dintre cele mai bune navigatoare web gratuite existente.
-Size = 31,0 Mo
+Size = 35,08 Mo
URLSite = http://www.mozilla.org/ro/
-URLDownload = http://ftp.mozilla.org/pub/mozilla.org/firefox/releases/32.0.1/win32/ro/Firefox%20Setup%2032.0.1.exe
+URLDownload = http://ftp.mozilla.org/pub/mozilla.org/firefox/releases/33.0/win32/ro/Firefox%20Setup%2033.0.exe
[Section.0419]
Description = Один из самых популярных и лучших бесплатных браузеров.
-Size = 30.94 MB
+Size = 34.95 MB
URLSite = http://www.mozilla.org/ru/
-URLDownload = http://ftp.mozilla.org/pub/mozilla.org/firefox/releases/32.0.1/win32/ru/Firefox%20Setup%2032.0.1.exe
+URLDownload = http://ftp.mozilla.org/pub/mozilla.org/firefox/releases/33.0/win32/ru/Firefox%20Setup%2033.0.exe
[Section.041b]
Description = Najpopulárnejší a jeden z najlepších slobodný webových prehliadačov.
-Size = 31.23 MB
+Size = 35.24 MB
URLSite = http://www.mozilla.org/sk/
-URLDownload = http://ftp.mozilla.org/pub/mozilla.org/firefox/releases/32.0.1/win32/sk/Firefox%20Setup%2032.0.1.exe
+URLDownload = http://ftp.mozilla.org/pub/mozilla.org/firefox/releases/33.0/win32/sk/Firefox%20Setup%2033.0.exe
[Section.041f]
Description = Özgür Umûmî Ağ tarayıcıları arasında en tutulanı ve en iyilerinden biri.
-Size = 30,58 MB
+Size = 34,59 MB
URLSite = http://www.mozilla.org/tr/
-URLDownload = http://ftp.mozilla.org/pub/mozilla.org/firefox/releases/32.0.1/win32/tr/Firefox%20Setup%2032.0.1.exe
+URLDownload = http://ftp.mozilla.org/pub/mozilla.org/firefox/releases/33.0/win32/tr/Firefox%20Setup%2033.0.exe
[Section.0422]
Description = Найпопулярніший та один з кращих безплатних веб-браузерів.
-Size = 30.97 MB
+Size = 34.98 MB
URLSite = http://www.mozilla.org/uk/
-URLDownload = http://ftp.mozilla.org/pub/mozilla.org/firefox/releases/32.0.1/win32/uk/Firefox%20Setup%2032.0.1.exe
+URLDownload = http://ftp.mozilla.org/pub/mozilla.org/firefox/releases/33.0/win32/uk/Firefox%20Setup%2033.0.exe
[Section.0813]
Description = De meest populaire en een van de beste gratis Web browsers.
-Size = 31.2 MB
+Size = 35.21 MB
URLSite = http://www.mozilla.org/nl/
-URLDownload = http://ftp.mozilla.org/pub/mozilla.org/firefox/releases/32.0.1/win32/nl/Firefox%20Setup%2032.0.1.exe
+URLDownload = http://ftp.mozilla.org/pub/mozilla.org/firefox/releases/33.0/win32/nl/Firefox%20Setup%2033.0.exe
[Section]
Name = Ghostscript
-Version = 9.14
+Version = 9.15
Licence = AGPL
Description = An open interpreter for the PostScript language and for PDF.
-Size = 12.44 MB
+Size = 12.65 MB
Category = 6
URLSite = http://www.ghostscript.com/
-URLDownload = http://downloads.ghostscript.com/public/gs914w32.exe
+URLDownload = http://downloads.ghostscript.com/public/gs915w32.exe
CDPath = none
[Section.0407]
[Section.0418]
Description = Un interpretor pentru limbajul PostScript și pentru PDF.
-Size = 12,44 Mo
+Size = 12,65 Mo
[Section.041f]
Description = PostScript dili ve PDF için bir açık kaynak yorumlayıcı.
-Size = 12,44 MB
+Size = 12,65 MB
Size = 1.81 MB\r
Category = 3\r
URLSite = http://www.irfanview.com/\r
-URLDownload = http://www.irfanview.info/files/iview438_setup.exe\r
+URLDownload = http://img.cs.montana.edu/windows/iview438_setup.exe\r
CDPath = none\r
\r
[Section.0407]\r
Size = 10.24 MB\r
Category = 3\r
URLSite = http://www.irfanview.com/\r
-URLDownload = http://www.irfanview.info/files/irfanview_plugins_438_setup.exe\r
+URLDownload = http://files.netmediaeurope.com/de-nmi/downloads/2014_download/irfanview_plugins_438_setup.exe\r
CDPath = none\r
\r
[Section.0407]\r
[Section]
Name = Lazarus
-Version = 1.2.4
+Version = 1.2.6
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 = 114 MB
+Size = 107 MB
Category = 7
URLSite = http://www.lazarus.freepascal.org/
-URLDownload = http://download.sourceforge.net/project/lazarus/Lazarus%20Windows%2032%20bits/Lazarus%201.2.4/lazarus-1.2.4-fpc-2.6.4-win32.exe
+URLDownload = http://download.sourceforge.net/project/lazarus/Lazarus%20Windows%2032%20bits/Lazarus%201.2.6/lazarus-1.2.6-fpc-2.6.4-win32.exe
CDPath = none
[Section.0407]
[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 = 114 Mo
+Size = 107 Mo
[Section.041f]
Licence = Değiştirilmiş LGPL, GPL
\r
[Section]\r
Name = LibreOffice\r
-Version = 4.3.1\r
+Version = 4.3.2\r
Licence = LGPL\r
Description = A powerful and open source office suite. It has been forked from OpenOffice.\r
-Size = 214.52 MB\r
+Size = 214.49 MB\r
Category = 6\r
URLSite = http://www.documentfoundation.org/\r
-URLDownload = http://download.documentfoundation.org/libreoffice/stable/4.3.1/win/x86/LibreOffice_4.3.1_Win_x86.msi\r
+URLDownload = http://download.documentfoundation.org/libreoffice/stable/4.3.2/win/x86/LibreOffice_4.3.2_Win_x86.msi\r
CDPath = none\r
\r
[Section.0407]\r
\r
[Section.040c]\r
Description = Précédemment appelé OpenOffice. Suite bureautique open source.\r
-Size = 209,36 Mo\r
+Size = 214,49 Mo\r
\r
[Section.0410]\r
Description = Precedentemente chiamato OpenOffice. Open Source Office Suite.\r
\r
[Section.0418]\r
Description = O suită office completă, cu surse deschise. Reprezintă o bifurcare a dezvoltării OpenOffice.\r
-Size = 209,36 Mo\r
+Size = 214,49 Mo\r
\r
[Section.041f]\r
Description = Güçlü ve açık kaynak bir ofis paketi. OpenOffice'ten çatallanılmıştır.\r
-Size = 209,36 MB\r
+Size = 214,49 MB\r
\r
[Section.0422]\r
Description = Відкритий офісний пакет.\r
Size = 163.18 MB
Category = 6
URLSite = http://www.miktex.org/
-URLDownload = http://mirrors.ctan.org/systems/win32/miktex/setup/basic-miktex-2.9.5105.exe
+URLDownload = http://ftp.gwdg.de/pub/ctan/systems/win32/miktex/setup/basic-miktex-2.9.5105.exe
CDPath = none
[Section.0407]
Version = 0.10.24\r
Licence = GPL\r
Description = Open source multiprotocol instant messaging application - May not work completely.\r
-Size = 3.8 MB\r
+Size = 3.77 MB\r
Category = 5\r
URLSite = http://www.miranda-im.org/\r
URLDownload = http://files.miranda-im.org/stable/0.10.24.0/miranda-im-v0.10.24-unicode.exe\r
\r
[Section.040c]\r
Description = Application de messagerie instantannée multi-protocoles open source - pourrait ne pas fonctionner complètement.\r
-Size = 3,8 Mo\r
+Size = 3,77 Mo\r
\r
[Section.0410]\r
Description = Multi-protocollo open source per applicazioni di messaggistica istantanea - potrebbe non funzionare del tutto.\r
\r
[Section.0418]\r
Description = Aplicație de mesagerie instant multiprotocol (cu surse deschise) - posibil cu limitări în funcționalitate.\r
-Size = 3,8 Mo\r
+Size = 3,77 Mo\r
\r
[Section.041f]\r
Description = Açık kaynak, çoklu iletişim kâideli, evgin iletileşme uygulaması. Eksiksiz olarak çalışmayabilir.\r
-Size = 3,8 MB\r
+Size = 3,77 MB\r
\r
[Section.0422]\r
Description = Відкрита мультипротокольна програма миттєвих повідомлень - може не працювати повністю.\r
\r
[Section]\r
Name = Mono .NET Development Framework\r
-Version = 2.11.4\r
+Version = 3.2.3\r
Licence = Unknown\r
Description = Open-source .NET Framework.\r
-Size = 91.93 MB\r
+Size = 98.49 MB\r
Category = 14\r
URLSite = http://www.mono-project.com/\r
-URLDownload = http://download.mono-project.com/archive/2.11.4/windows-installer/mono-2.11.4-gtksharp-2.12.11-win32-0.exe\r
+URLDownload = http://download.mono-project.com/archive/3.2.3/windows-installer/mono-3.2.3-gtksharp-2.12.11-win32-0.exe\r
CDPath = none\r
\r
[Section.0407]\r
\r
[Section.040c]\r
Description = Framework .NET open source.\r
-Size = 91,93 Mo\r
+Size = 98,49 Mo\r
\r
[Section.0410]\r
Description = Versione Open-source di .NET Framework.\r
[Section.0418]\r
Licence = Nespecificată\r
Description = Platformă .NET (cu surse deschise).\r
-Size = 91,93 Mo\r
+Size = 98,49 Mo\r
\r
[Section.041f]\r
Name = Mono .NET Geliştirme Çatısı\r
Licence = Bilinmiyor\r
Description = Açık kaynak .NET Çatısı.\r
-Size = 91,93 MB\r
+Size = 98,49 MB\r
\r
[Section.0422]\r
Description = Відкритий .NET Фреймворк.\r
\r
[Section]\r
Name = Media Player Classic Home Cinema\r
-Version = 1.7.6\r
+Version = 1.7.7\r
Licence = GPL\r
Description = A media player.\r
-Size = 10.3 MB\r
+Size = 10.7 MB\r
Category = 2\r
URLSite = http://mpc-hc.org/\r
-URLDownload = http://download.sourceforge.net/project/mpc-hc/MPC%20HomeCinema%20-%20Win32/MPC-HC_v1.7.6_x86/MPC-HC.1.7.6.x86.exe\r
+URLDownload = http://download.sourceforge.net/project/mpc-hc/MPC%20HomeCinema%20-%20Win32/MPC-HC_v1.7.7_x86/MPC-HC.1.7.7.x86.exe\r
CDPath = none\r
\r
[Section.0407]\r
\r
[Section.040c]\r
Description = Un lecteur media.\r
-Size = 10,3 Mo\r
+Size = 10,7 Mo\r
\r
[Section.0410]\r
Description = Lettore multimediale.\r
\r
[Section.0418]\r
Description = Lector multimedia.\r
-Size = 10,3 Mo\r
+Size = 10,7 Mo\r
\r
[Section.0419]\r
Description = Мультимедийный проигрыватель.\r
\r
[Section.041f]\r
Description = Bir ortam oynatıcısı.\r
-Size = 10,3 MB\r
+Size = 10,7 MB\r
\r
[Section.0422]\r
Description = Мультимедійний програвач.\r
[Section]
Name = NirLauncher
-Version = 1.18.76
+Version = 1.19.5
Licence = Freeware
Description = A package of more than 180 utilities for Windows.
-Size = 19.8 MB
+Size = 20.2 MB
Category = 12
URLSite = http://launcher.nirsoft.net/
-URLDownload = http://download.nirsoft.net/nirsoft_package_1.18.76.zip
+URLDownload = http://download.nirsoft.net/nirsoft_package_1.19.5.zip
CDPath = none
[Section.0407]
\r
[Section]\r
Name = OpenTTD\r
-Version = 1.4.2\r
+Version = 1.4.4\r
Licence = GPL v2\r
Description = Open Source clone of the "Transport Tycoon Deluxe" game engine. You need a copy of Transport Tycoon.\r
Size = 7.0 MB\r
Category = 4\r
URLSite = http://www.openttd.org/\r
-URLDownload = http://binaries.openttd.org/releases/1.4.2/openttd-1.4.2-windows-win32.exe\r
+URLDownload = http://binaries.openttd.org/releases/1.4.4/openttd-1.4.4-windows-win32.exe\r
CDPath = none\r
\r
[Section.0407]\r
[Section]
Name = PeaZip
-Version = 5.4.1
+Version = 5.5.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
+Size = 5.9 MB
Category = 12
URLSite = http://peazip.sourceforge.net/
-URLDownload = http://download.sourceforge.net/project/peazip/5.4.1/peazip-5.4.1.WINDOWS.exe
+URLDownload = http://download.sourceforge.net/project/peazip/5.5.0/peazip-5.5.0.WINDOWS.exe
CDPath = none
[Section.0407]
[Section.0418]
Description = PeaZip este un gestionar de fișiere și arhive gratuit, multi-platformă, cu sursă deschisă. Recunoaște peste 150 tipuri de arhive.
-Size = 5,8 Mo
+Size = 5,9 Mo
[Section.041f]
Licence = LGPL 3. sürüm, OpenCandy EULA
Description = PeaZip; ücretsiz, çapraz platform, açık kaynak kütük ve belgelik yöneticisidir. 150'den çok belgelikleme biçimini destekler.
-Size = 5,8 MB
+Size = 5,9 MB
Size = 4.46 MB
Category = 6
URLSite = http://www.pspad.com
-URLDownload = http://www.fosshub.com/download/pspad458instim_en.exe
+URLDownload = http://pspad.poradna.net/release/pspad458insti_en.exe
CDPath = none
[Section.0407]
[Section]
Name = Python 3
-Version = 3.4.1
+Version = 3.4.2
Licence = GPL/LGPL
Description = A remarkably powerful dynamic programming language.
-Size = 23.3 MB
+Size = 23.39 MB
Category = 7
URLSite = http://www.python.org/
-URLDownload = http://www.python.org/ftp/python/3.4.1/python-3.4.1.msi
+URLDownload = http://www.python.org/ftp/python/3.4.2/python-3.4.2.msi
CDPath = none
[Section.0407]
[Section.040c]
Description = Un langage de programmation dynamique remarquablement puissant.
-Size = 23,3 Mo
+Size = 23,39 Mo
[Section.0410]
Description = Un Linguaggio di programmazione dinamico e potente.
[Section.0418]
Description = Un limbaj de programare dinamic și puternic.
-Size = 23,3 Mo
+Size = 23,39 Mo
[Section.041f]
Description = Dikkat çekici, güçlü ve devingen bir izlenceleme dili.
-Size = 23,3 MB
+Size = 23,39 MB
[Section.0422]
Description = Дуже потужна динамічна мова програмування.
\r
[Section]\r
Name = Python 2\r
-Version = 2.7.6\r
+Version = 2.7.8\r
Licence = GPL/LGPL\r
Description = A remarkably powerful dynamic programming language.\r
-Size = 15.48 MB\r
+Size = 15.93 MB\r
Category = 7\r
URLSite = http://www.python.org/\r
-URLDownload = http://www.python.org/ftp/python/2.7.6/python-2.7.6.msi\r
+URLDownload = http://www.python.org/ftp/python/2.7.8/python-2.7.8.msi\r
CDPath = none\r
\r
[Section.0407]\r
\r
[Section.040c]\r
Description = Un langage de programmation dynamique remarquablement puissant.\r
-Size = 15,48 Mo\r
+Size = 15,93 Mo\r
\r
[Section.0410]\r
Description = Un Linguaggio di programmazione dinamico e potente.\r
\r
[Section.0418]\r
Description = Un limbaj de programare dinamic și puternic.\r
-Size = 15,48 Mo\r
+Size = 15,93 Mo\r
\r
[Section.041f]\r
Description = Dikkat çekici, güçlü ve devingen bir izlenceleme dili.\r
-Size = 15,48 MB\r
+Size = 15,93 MB\r
\r
[Section.0422]\r
Description = Дуже потужна динамічна мова програмування.\r
[Section]
Name = Qmmp (Qt-based Multimedia Player)
-Version = 0.8.1
+Version = 0.8.2
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.
-Size = 12.51 MB
+Size = 12.66 MB
Category = 1
URLSite = http://qmmp.ylsoftware.com/
-URLDownload = http://qmmp.ylsoftware.com/files/windows/qmmp-0.8.1-win32.exe
+URLDownload = http://qmmp.ylsoftware.com/files/windows/qmmp-0.8.2-win32.exe
CDPath = none
[Section.0407]
[Section.0418]
Name = Qmmp (Lector Multimedia bazat pe Qt)
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 = 12,51 Mo
+Size = 12,66 Mo
[Section.0419]
Description = Аудиоплеер Qmmp (Qt-based Multimedia Player).
[Section.041f]
Name = Qmmp (Qt Tabanlı Çoklu Ortam Oynatıcısı)
Description = Qmmp, Qt kitaplığının yardımıyla yazılmış bir ses oynatıcısıdır. Kullanıcı arayüzü WinAMP'a ve XMMS'ye benzer. Başka kullanıcı arayüzleri de vardır.
-Size = 12,51 MB
+Size = 12,66 MB
\r
[Section]\r
Name = SciTE\r
-Version = 3.5.0\r
+Version = 3.5.1\r
Licence = Freeware\r
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.\r
-Size = 742 kB\r
+Size = 744 kB\r
Category = 7\r
URLSite = http://www.scintilla.org/\r
-URLDownload = http://download.sourceforge.net/project/scintilla/SciTE/3.5.0/Sc350.exe\r
+URLDownload = http://download.sourceforge.net/project/scintilla/SciTE/3.5.1/Sc351.exe\r
CDPath = none\r
\r
[Section.0407]\r
\r
[Section.040c]\r
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.\r
-Size = 742 ko\r
+Size = 744 ko\r
\r
[Section.0410]\r
Description = SciTE è un editor di testo basato su scintilla. Originariamente costruito per dimostrare Scintilla, è cresciuto fino a essere un editor generalmente utile con strutture per la creazione e l'esecuzione di programmi.\r
[Section.0418]\r
Licence = Gratuită\r
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.\r
-Size = 742 ko\r
+Size = 744 ko\r
\r
[Section.041f]\r
Licence = Ücretsiz\r
Description = SciTE, bir Scintilla tabanlı metin düzenleyicisidir. İlk başta Scintilla'yı göstermek için yapıldı; izlenceleri yapmak ve çalıştırmak yetenekleriyle, umûmiyetle kullanışlı bir düzenleyici olmak için gelişti.\r
-Size = 742 KB\r
+Size = 744 KB\r
\r
[Section.0422]\r
Description = Текстовий редактор на основі SCIntilla. Був зібраний як презентація Scintilla, але виріс до редактора загального користування з засобами збирання та запуску програм.\r
\r
[Section]\r
Name = Mozilla SeaMonkey\r
-Version = 2.29\r
+Version = 2.30\r
Licence = MPL/GPL/LGPL\r
Description = Mozilla Suite is alive. This is the one and only Browser, Mail, Chat, and Composer bundle you will ever need.\r
-Size = 30.17 MB\r
+Size = 30.05 MB\r
Category = 5\r
URLSite = http://www.seamonkey-project.org/\r
-URLDownload = http://ftp.mozilla.org/pub/mozilla.org/seamonkey/releases/2.29/win32/en-US/SeaMonkey%20Setup%202.29.exe\r
+URLDownload = http://ftp.mozilla.org/pub/mozilla.org/seamonkey/releases/2.30/win32/en-US/SeaMonkey%20Setup%202.30.exe\r
CDPath = none\r
\r
[Section.0407]\r
Description = Mozilla Suite lebt. Dies ist das einzige Browser-, Mail-, Chat- and Composerwerkzeug-Bundle welches Sie benötigen.\r
-Size = 30.05 MB\r
-URLDownload = http://ftp.mozilla.org/pub/mozilla.org/seamonkey/releases/2.29/win32/de/SeaMonkey%20Setup%202.29.exe\r
+Size = 29.92 MB\r
+URLDownload = http://ftp.mozilla.org/pub/mozilla.org/seamonkey/releases/2.30/win32/de/SeaMonkey%20Setup%202.30.exe\r
\r
[Section.040a]\r
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.\r
-Size = 30.03 MB\r
-URLDownload = http://ftp.mozilla.org/pub/mozilla.org/seamonkey/releases/2.29/win32/es-ES/SeaMonkey%20Setup%202.29.exe\r
+Size = 29.91 MB\r
+URLDownload = http://ftp.mozilla.org/pub/mozilla.org/seamonkey/releases/2.30/win32/es-ES/SeaMonkey%20Setup%202.30.exe\r
\r
[Section.040c]\r
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.\r
-Size = 30,30 Mo\r
-URLDownload = http://ftp.mozilla.org/pub/mozilla.org/seamonkey/releases/2.29/win32/fr/SeaMonkey%20Setup%202.29.exe\r
+Size = 30,18 Mo\r
+URLDownload = http://ftp.mozilla.org/pub/mozilla.org/seamonkey/releases/2.30/win32/fr/SeaMonkey%20Setup%202.30.exe\r
\r
[Section.0410]\r
Description = Mozilla Suite è vivo. Questo è l'unico pachetto che include Browser, Mail, Chat, e Composer di cui avrete mai bisogno...\r
-Size = 29.97 MB\r
-URLDownload = http://ftp.mozilla.org/pub/mozilla.org/seamonkey/releases/2.29/win32/it/SeaMonkey%20Setup%202.29.exe\r
+Size = 29.84 MB\r
+URLDownload = http://ftp.mozilla.org/pub/mozilla.org/seamonkey/releases/2.30/win32/it/SeaMonkey%20Setup%202.30.exe\r
\r
[Section.0413]\r
Description = Mozilla Suite bundelt alle applicaties voor het Web: Browser, Mail, Chat, Composer.\r
-Size = 30.65 MB\r
-URLDownload = http://ftp.mozilla.org/pub/mozilla.org/seamonkey/releases/2.29/win32/nl/SeaMonkey%20Setup%202.29.exe\r
+Size = 30.52 MB\r
+URLDownload = http://ftp.mozilla.org/pub/mozilla.org/seamonkey/releases/2.30/win32/nl/SeaMonkey%20Setup%202.30.exe\r
\r
[Section.0415]\r
Description = Pakiet Mozilla żyje. W zestawie: przeglądarka, klient poczty, IRC oraz Edytor HTML - wszystko, czego potrzebujesz.\r
-Size = 30.96 MB\r
-URLDownload = http://ftp.mozilla.org/pub/mozilla.org/seamonkey/releases/2.29/win32/pl/SeaMonkey%20Setup%202.29.exe\r
+Size = 30.83 MB\r
+URLDownload = http://ftp.mozilla.org/pub/mozilla.org/seamonkey/releases/2.30/win32/pl/SeaMonkey%20Setup%202.30.exe\r
\r
[Section.0418]\r
Description = Suita Mozilla. Acest pachet încorporează navigator, poștă electronică, client IRC și editor HTML, acoperind astfel o arie largă de necesități.\r
\r
[Section.0419]\r
Description = Продолжение Mozilla Suite. Включает браузер, почтовый клиент, IRC-клиент и HTML-редактор.\r
-Size = 30.52 MB\r
-URLDownload = http://ftp.mozilla.org/pub/mozilla.org/seamonkey/releases/2.29/win32/ru/SeaMonkey%20Setup%202.29.exe\r
+Size = 30.39 MB\r
+URLDownload = http://ftp.mozilla.org/pub/mozilla.org/seamonkey/releases/2.30/win32/ru/SeaMonkey%20Setup%202.30.exe\r
\r
[Section.041f]\r
Description = Mozilla Bohçası sağ. Bu, hiç gereksinim duymayacağınız, yalnızca Tarayıcı, Posta, Söyleşi ve Yazar bohçasıdır.\r
-Size = 30,02 MB\r
-URLDownload = http://ftp.mozilla.org/pub/mozilla.org/seamonkey/releases/2.29/win32/tr/SeaMonkey%20Setup%202.29.exe\r
-\r
-[Section.0422]\r
-Description = Продовження Mozilla Suite. Включає в себе браузер, поштовий клієнт, IRC-клієнт та HTML-редактор.\r
-Size = 30.52 MB\r
-URLDownload = http://ftp.mozilla.org/pub/mozilla.org/seamonkey/releases/2.29/win32/ru/SeaMonkey%20Setup%202.29.exe\r
+Size = 29,89 MB\r
+URLDownload = http://ftp.mozilla.org/pub/mozilla.org/seamonkey/releases/2.30/win32/tr/SeaMonkey%20Setup%202.30.exe\r
Size = 4.0 MB\r
Category = 6\r
URLSite = http://blog.kowalczyk.info/software/sumatrapdf/free-pdf-reader.html\r
-URLDownload = https://kjkpub.s3.amazonaws.com/sumatrapdf/rel/SumatraPDF-2.5.2-install.exe\r
+URLDownload = http://kjkpub.s3.amazonaws.com/sumatrapdf/rel/SumatraPDF-2.5.2-install.exe\r
CDPath = none\r
\r
[Section.0407]\r
[Section]
Name = Mozilla Thunderbird 31
-Version = 31.1.1
+Version = 31.2.0
Licence = MPL/GPL/LGPL
Description = The most popular and one of the best free Mail Clients out there.
Size = 25.25 MB
Category = 5
URLSite = https://www.mozilla.org/en-US/thunderbird/
-URLDownload = http://ftp.mozilla.org/pub/mozilla.org/thunderbird/releases/31.1.1/win32/en-US/Thunderbird%20Setup%2031.1.1.exe
+URLDownload = http://ftp.mozilla.org/pub/mozilla.org/thunderbird/releases/31.2.0/win32/en-US/Thunderbird%20Setup%2031.2.0.exe
CDPath = none
[Section.0407]
Description = Der populärste und einer der besten freien Mail-Clients.
-Size = 25.09 MB
+Size = 25.1 MB
URLSite = https://www.mozilla.org/de/thunderbird/
-URLDownload = http://ftp.mozilla.org/pub/mozilla.org/thunderbird/releases/31.1.1/win32/de/Thunderbird%20Setup%2031.1.1.exe
+URLDownload = http://ftp.mozilla.org/pub/mozilla.org/thunderbird/releases/31.2.0/win32/de/Thunderbird%20Setup%2031.2.0.exe
[Section.040a]
Description = El más popular y uno de los mejores clientes mail que hay.
Size = 25.04 MB
URLSite = https://www.mozilla.org/es-ES/thunderbird/
-URLDownload = http://ftp.mozilla.org/pub/mozilla.org/thunderbird/releases/31.1.1/win32/es-ES/Thunderbird%20Setup%2031.1.1.exe
+URLDownload = http://ftp.mozilla.org/pub/mozilla.org/thunderbird/releases/31.2.0/win32/es-ES/Thunderbird%20Setup%2031.2.0.exe
[Section.040c]
Description = Le plus populaire et l'un des meilleurs clients mail gratuits disponible.
-Size = 25,39 Mo
+Size = 25,4 Mo
URLSite = https://www.mozilla.org/fr/thunderbird/
-URLDownload = http://ftp.mozilla.org/pub/mozilla.org/thunderbird/releases/31.1.1/win32/fr/Thunderbird%20Setup%2031.1.1.exe
+URLDownload = http://ftp.mozilla.org/pub/mozilla.org/thunderbird/releases/31.2.0/win32/fr/Thunderbird%20Setup%2031.2.0.exe
[Section.0410]
Description = Il più popolare e il migliore Client mail gratuito.
Size = 25.04 MB
URLSite = https://www.mozilla.org/it/thunderbird/
-URLDownload = http://ftp.mozilla.org/pub/mozilla.org/thunderbird/releases/31.1.1/win32/it/Thunderbird%20Setup%2031.1.1.exe
+URLDownload = http://ftp.mozilla.org/pub/mozilla.org/thunderbird/releases/31.2.0/win32/it/Thunderbird%20Setup%2031.2.0.exe
[Section.0413]
Description = De meest populaire en een van de beste gratis e-mail-programma's.
-Size = 25.73 MB
+Size = 25.74 MB
URLSite = https://www.mozilla.org/nl/thunderbird/
-URLDownload = http://ftp.mozilla.org/pub/mozilla.org/thunderbird/releases/31.1.1/win32/nl/Thunderbird%20Setup%2031.1.1.exe
+URLDownload = http://ftp.mozilla.org/pub/mozilla.org/thunderbird/releases/31.2.0/win32/nl/Thunderbird%20Setup%2031.2.0.exe
[Section.0415]
Description = Najpopularniejszy i jeden z najlepszych darmowych klientów poczty.
-Size = 25.95 MB
+Size = 25.96 MB
URLSite = https://www.mozilla.org/pl/thunderbird/
-URLDownload = http://ftp.mozilla.org/pub/mozilla.org/thunderbird/releases/31.1.1/win32/pl/Thunderbird%20Setup%2031.1.1.exe
+URLDownload = http://ftp.mozilla.org/pub/mozilla.org/thunderbird/releases/31.2.0/win32/pl/Thunderbird%20Setup%2031.2.0.exe
[Section.0418]
Description = Cel mai popular și unul dintre cele mai bune clientele gratuite de poștă electronică.
Size = 25,61 Mo
URLSite = https://www.mozilla.org/ro/thunderbird/
-URLDownload = http://ftp.mozilla.org/pub/mozilla.org/thunderbird/releases/31.1.1/win32/ro/Thunderbird%20Setup%2031.1.1.exe
+URLDownload = http://ftp.mozilla.org/pub/mozilla.org/thunderbird/releases/31.2.0/win32/ro/Thunderbird%20Setup%2031.2.0.exe
[Section.0419]
Description = Один из самых популярных и лучших бесплатных почтовых клиентов.
-Size = 25.5 MB
+Size = 25.51 MB
URLSite = https://www.mozilla.org/ru/thunderbird/
-URLDownload = http://ftp.mozilla.org/pub/mozilla.org/thunderbird/releases/31.1.1/win32/ru/Thunderbird%20Setup%2031.1.1.exe
+URLDownload = http://ftp.mozilla.org/pub/mozilla.org/thunderbird/releases/31.2.0/win32/ru/Thunderbird%20Setup%2031.2.0.exe
[Section.041f]
Description = Özgür posta istemcileri arasında en tutulanı ve en iyilerinden biri.
-Size = 25,12 MB
+Size = 25,13 MB
URLSite = https://www.mozilla.org/tr/thunderbird/
-URLDownload = http://ftp.mozilla.org/pub/mozilla.org/thunderbird/releases/31.1.1/win32/tr/Thunderbird%20Setup%2031.1.1.exe
+URLDownload = http://ftp.mozilla.org/pub/mozilla.org/thunderbird/releases/31.2.0/win32/tr/Thunderbird%20Setup%2031.2.0.exe
[Section.0422]
Description = Найпопулярніший та один з кращих поштових клієнтів.
Size = 25.54 MB
URLSite = https://www.mozilla.org/uk/thunderbird/
-URLDownload = http://ftp.mozilla.org/pub/mozilla.org/thunderbird/releases/31.1.1/win32/uk/Thunderbird%20Setup%2031.1.1.exe
+URLDownload = http://ftp.mozilla.org/pub/mozilla.org/thunderbird/releases/31.2.0/win32/uk/Thunderbird%20Setup%2031.2.0.exe
[Section.0813]
Description = De meest populaire en een van de beste gratis e-mail-programma's.
-Size = 25.73 MB
+Size = 25.74 MB
URLSite = https://www.mozilla.org/nl/thunderbird/
-URLDownload = http://ftp.mozilla.org/pub/mozilla.org/thunderbird/releases/31.1.1/win32/nl/Thunderbird%20Setup%2031.1.1.exe
+URLDownload = http://ftp.mozilla.org/pub/mozilla.org/thunderbird/releases/31.2.0/win32/nl/Thunderbird%20Setup%2031.2.0.exe
\r
[Section]\r
Name = UltraVNC\r
-Version = 1.2.0.1\r
+Version = 1.2.0.3\r
Licence = GPL\r
Description = Open source VNC client/server.\r
-Size = 3.29 MB\r
+Size = 3.22 MB\r
Category = 5\r
URLSite = http://www.uvnc.com/\r
-URLDownload = http://support1.uvnc.com/download/1201/UltraVNC_1_2_01_X86_Setup.exe\r
+URLDownload = http://www.uvnc.eu/download/1203/UltraVNC_1_2_03_X86_Setup.exe\r
CDPath = none\r
\r
[Section.0407]\r
\r
[Section.040c]\r
Description = Client/serveur VNC open source.\r
-Size = 3,29 Mo\r
+Size = 3,22 Mo\r
\r
[Section.0410]\r
Description = Client/server VNC open source.\r
\r
[Section.0418]\r
Description = Client/server VNC (cu surse deschise).\r
-Size = 3,29 Mo\r
+Size = 3,22 Mo\r
\r
[Section.041f]\r
Description = Açık kaynak VNC istemcisi ve sunucusu.\r
-Size = 3,29 MB\r
+Size = 3,22 MB\r
\r
[Section.0422]\r
Description = Відкритий VNC клієнт/сервер.\r
Version = 3.4.2\r
Licence = Freeware for non-commercial uses\r
Description = Small and fast BitTorrent Client.\r
-Size = 1.6 MB\r
+Size = 1.61 MB\r
Category = 5\r
URLSite = http://www.utorrent.com/\r
URLDownload = http://download-new.utorrent.com/endpoint/utorrent/os/windows/track/stable/utorrent.exe\r
[Section.040c]\r
Licence = Gratuit pour une utilisation non-commerciale\r
Description = Client BitTorrent petit et rapide.\r
-Size = 1,6 Mo\r
+Size = 1,61 Mo\r
\r
[Section.040c]\r
Licence = Gratita per un uso non-commerciale\r
[Section.0418]\r
Licence = Gratuită pentru uz necomercial\r
Description = Client BitTorrent, mic și rapid.\r
-Size = 1,6 Mo\r
+Size = 1,61 Mo\r
\r
[Section.0419]\r
Licence = Бесплатная для некоммерческого использования\r
[Section.041f]\r
Licence = Tecimlik olmayan kullanımlar için ücretsiz.\r
Description = Küçük ve hızlı BitTorrent istemcisi.\r
-Size = 1,6 MB\r
+Size = 1,61 MB\r
\r
[Section.0422]\r
Licence = Безплатна для некомерційного використання\r
HWND hStatusWnd; /* Status Bar Window */
HWND hTabWnd; /* Tab Control Window */
+HMENU hWindowMenu = NULL;
+
int nMinimumWidth; /* Minimum width of the dialog (OnSize()'s cx) */
int nMinimumHeight; /* Minimum height of the dialog (OnSize()'s cy) */
SaveSettings();
PerfDataUninitialize();
CloseHandle(hMutex);
+ if (hWindowMenu)
+ DestroyMenu(hWindowMenu);
return 0;
}
RemoveMenu(hViewMenu, i, MF_BYPOSITION);
}
RemoveMenu(hOptionsMenu, 3, MF_BYPOSITION);
+ if (hWindowMenu)
+ DestroyMenu(hWindowMenu);
switch (TaskManagerSettings.ActiveTabPage) {
case 0:
ShowWindow(hApplicationPage, SW_SHOW);
AppendMenuW(hViewMenu, MF_STRING, ID_VIEW_DETAILS, szTemp);
if (GetMenuItemCount(hMenu) <= 5) {
- hSubMenu = LoadMenuW(hInst, MAKEINTRESOURCEW(IDR_WINDOWSMENU));
+ hWindowMenu = LoadMenuW(hInst, MAKEINTRESOURCEW(IDR_WINDOWSMENU));
LoadStringW(hInst, IDS_MENU_WINDOWS, szTemp, 256);
- InsertMenuW(hMenu, 3, MF_BYPOSITION|MF_POPUP, (UINT_PTR) hSubMenu, szTemp);
+ InsertMenuW(hMenu, 3, MF_BYPOSITION|MF_POPUP, (UINT_PTR) hWindowMenu, szTemp);
DrawMenuBar(hMainWnd);
}
:: Precisely needed for configuring Visual Studio Environment.\r
setlocal enabledelayedexpansion\r
\r
+:: Does the user need help?\r
+if /I "%1" == "help" goto help\r
+if /I "%1" == "/?" (\r
+:help\r
+ echo Help for configure script\r
+ echo Syntax: path\to\source\configure.cmd [script-options] [Cmake-options]\r
+ echo Available script-options: Codeblocks, Eclipse, Makefiles, clang, VSSolution, RTC\r
+ echo Cmake-options: -DVARIABLE:TYPE=VALUE\r
+ exit /b\r
+)\r
+\r
:: Special case %1 = arm_hosttools %2 = vcvarsall.bat %3 = %CMAKE_GENERATOR%\r
if /I "%1" == "arm_hosttools" (\r
echo Configuring x86 host tools for ARM cross build\r
\r
:: Get the source root directory\r
set REACTOS_SOURCE_DIR=%~dp0\r
-set USE_VSCMD=0\r
+\r
+:: Set default generator\r
+set CMAKE_GENERATOR="Ninja"\r
+set CMAKE_GENERATOR_HOST=!CMAKE_GENERATOR!\r
\r
:: Detect presence of cmake\r
cmd /c cmake --version 2>&1 | find "cmake version" > NUL || goto cmake_notfound\r
echo Detected RosBE for %ROS_ARCH%\r
set BUILD_ENVIRONMENT=MinGW\r
set ARCH=%ROS_ARCH%\r
- if /I "%1" == "Codeblocks" (\r
- set CMAKE_GENERATOR="CodeBlocks - MinGW Makefiles"\r
- ) else if /I "%1" == "Eclipse" (\r
- set CMAKE_GENERATOR="Eclipse CDT4 - MinGW Makefiles"\r
- ) else if /I "%1" == "Makefiles" (\r
- set CMAKE_GENERATOR="MinGW Makefiles"\r
- ) else if /I "%1" == "clang" (\r
- set BUILD_ENVIRONMENT=Clang\r
- set CMAKE_GENERATOR="Ninja"\r
- ) else (\r
- set CMAKE_GENERATOR="Ninja"\r
- )\r
+ set MINGW_TOOCHAIN_FILE=toolchain-gcc.cmake\r
\r
) else if defined VCINSTALLDIR (\r
:: VS command prompt does not put this in environment vars\r
cl 2>&1 | find "x86" > NUL && set ARCH=i386\r
cl 2>&1 | find "x64" > NUL && set ARCH=amd64\r
cl 2>&1 | find "ARM" > NUL && set ARCH=arm\r
- cl 2>&1 | find "15.00." > NUL && set BUILD_ENVIRONMENT=VS9\r
- cl 2>&1 | find "16.00." > NUL && set BUILD_ENVIRONMENT=VS10\r
- cl 2>&1 | find "17.00." > NUL && set BUILD_ENVIRONMENT=VS11\r
- cl 2>&1 | find "18.00." > NUL && set BUILD_ENVIRONMENT=VS12\r
- if not defined BUILD_ENVIRONMENT (\r
+ cl 2>&1 | find "15.00." > NUL && set VS_VERSION=9\r
+ cl 2>&1 | find "16.00." > NUL && set VS_VERSION=10\r
+ cl 2>&1 | find "17.00." > NUL && set VS_VERSION=11\r
+ cl 2>&1 | find "18.00." > NUL && set VS_VERSION=12\r
+ if not defined VS_VERSION (\r
echo Error: Visual Studio version too old or version detection failed.\r
exit /b\r
)\r
-\r
- echo Detected Visual Studio Environment !BUILD_ENVIRONMENT!-!ARCH!\r
- if /I "%1" == "VSSolution" (\r
- if "!BUILD_ENVIRONMENT!" == "VS9" (\r
- if "!ARCH!" == "amd64" (\r
- set CMAKE_GENERATOR="Visual Studio 9 2008 Win64"\r
- ) else (\r
- set CMAKE_GENERATOR="Visual Studio 9 2008"\r
- )\r
- ) else if "!BUILD_ENVIRONMENT!" == "VS10" (\r
- if "!ARCH!" == "amd64" (\r
- set CMAKE_GENERATOR="Visual Studio 10 Win64"\r
- ) else (\r
- set CMAKE_GENERATOR="Visual Studio 10"\r
- )\r
- ) else if "!BUILD_ENVIRONMENT!" == "VS11" (\r
- if "!ARCH!" == "amd64" (\r
- set CMAKE_GENERATOR="Visual Studio 11 Win64"\r
- ) else if "!ARCH!" == "arm" (\r
- set CMAKE_GENERATOR="Visual Studio 11 ARM"\r
- set CMAKE_GENERATOR_HOST="Visual Studio 11"\r
- ) else (\r
- set CMAKE_GENERATOR="Visual Studio 11"\r
- )\r
- ) else if "!BUILD_ENVIRONMENT!" == "VS12" (\r
- if "!ARCH!" == "amd64" (\r
- set CMAKE_GENERATOR="Visual Studio 12 Win64"\r
- ) else if "!ARCH!" == "arm" (\r
- set CMAKE_GENERATOR="Visual Studio 12 ARM"\r
- set CMAKE_GENERATOR_HOST="Visual Studio 12"\r
- ) else (\r
- set CMAKE_GENERATOR="Visual Studio 12"\r
- )\r
- )\r
- ) else (\r
- set USE_VSCMD=1\r
- echo This script defaults to Ninja. To use Visual Studio GUI specify "VSSolution" as a parameter.\r
- )\r
-\r
+ set BUILD_ENVIRONMENT=VS\r
+ set VS_SOLUTION=0\r
+ set VS_RUNTIME_CHECKS=0\r
+ echo Detected Visual Studio Environment !BUILD_ENVIRONMENT!!VS_VERSION!-!ARCH!\r
) else (\r
echo Error: Unable to detect build environment. Configure script failure.\r
exit /b\r
exit /b\r
)\r
\r
-:: Detect VS command line generator\r
-if %USE_VSCMD% == 1 (\r
- if /I "%1" == "CodeBlocks" (\r
- set CMAKE_GENERATOR="CodeBlocks - NMake Makefiles"\r
- ) else if /I "%1" == "Eclipse" (\r
- set CMAKE_GENERATOR="Eclipse CDT4 - NMake Makefiles"\r
- ) else if /I "%1" == "Makefiles" (\r
- set CMAKE_GENERATOR="NMake Makefiles"\r
+:: Parse command line parameters\r
+:repeat\r
+ if "%BUILD_ENVIRONMENT%" == "MinGW" (\r
+ if /I "%1" == "Codeblocks" (\r
+ set CMAKE_GENERATOR="CodeBlocks - MinGW Makefiles"\r
+ ) else if /I "%1" == "Eclipse" (\r
+ set CMAKE_GENERATOR="Eclipse CDT4 - MinGW Makefiles"\r
+ ) else if /I "%1" == "Makefiles" (\r
+ set CMAKE_GENERATOR="MinGW Makefiles"\r
+ ) else if /I "%1" == "clang" (\r
+ set MINGW_TOOCHAIN_FILE=toolchain-clang.cmake\r
+ ) else (\r
+ goto continue\r
+ )\r
) else (\r
- set CMAKE_GENERATOR="Ninja"\r
- )\r
- if "!ARCH!" == "arm" (\r
- set CMAKE_GENERATOR_HOST=!CMAKE_GENERATOR!\r
+ if /I "%1" == "CodeBlocks" (\r
+ set CMAKE_GENERATOR="CodeBlocks - NMake Makefiles"\r
+ ) else if /I "%1" == "Eclipse" (\r
+ set CMAKE_GENERATOR="Eclipse CDT4 - NMake Makefiles"\r
+ ) else if /I "%1" == "Makefiles" (\r
+ set CMAKE_GENERATOR="NMake Makefiles"\r
+ ) else if /I "%1" == "VSSolution" (\r
+ set VS_SOLUTION=1\r
+ if "!VS_VERSION!" == "9" (\r
+ if "!ARCH!" == "amd64" (\r
+ set CMAKE_GENERATOR="Visual Studio 9 2008 Win64"\r
+ ) else (\r
+ set CMAKE_GENERATOR="Visual Studio 9 2008"\r
+ )\r
+ ) else if "!VS_VERSION!" == "10" (\r
+ if "!ARCH!" == "amd64" (\r
+ set CMAKE_GENERATOR="Visual Studio 10 Win64"\r
+ ) else (\r
+ set CMAKE_GENERATOR="Visual Studio 10"\r
+ )\r
+ ) else if "!VS_VERSION!" == "11" (\r
+ if "!ARCH!" == "amd64" (\r
+ set CMAKE_GENERATOR="Visual Studio 11 Win64"\r
+ ) else if "!ARCH!" == "arm" (\r
+ set CMAKE_GENERATOR="Visual Studio 11 ARM"\r
+ set CMAKE_GENERATOR_HOST="Visual Studio 11"\r
+ ) else (\r
+ set CMAKE_GENERATOR="Visual Studio 11"\r
+ )\r
+ ) else if "!VS_VERSION!" == "12" (\r
+ if "!ARCH!" == "amd64" (\r
+ set CMAKE_GENERATOR="Visual Studio 12 Win64"\r
+ ) else if "!ARCH!" == "arm" (\r
+ set CMAKE_GENERATOR="Visual Studio 12 ARM"\r
+ set CMAKE_GENERATOR_HOST="Visual Studio 12"\r
+ ) else (\r
+ set CMAKE_GENERATOR="Visual Studio 12"\r
+ )\r
+ )\r
+ ) else if /I "%1" == "RTC" (\r
+ echo Runtime checks enabled\r
+ set VS_RUNTIME_CHECKS=1\r
+ ) else (\r
+ goto continue\r
+ )\r
)\r
+\r
+ :: Go to next parameter\r
+ SHIFT\r
+ goto repeat\r
+:continue\r
+\r
+:: Inform the user about the default build\r
+if "!CMAKE_GENERATOR!" == "Ninja" (\r
+ echo This script defaults to Ninja. Type "configure help" for alternative options.\r
)\r
\r
:: Create directories\r
)\r
\r
if "%BUILD_ENVIRONMENT%" == "MinGW" (\r
- cmake -G %CMAKE_GENERATOR% -DENABLE_CCACHE:BOOL=0 -DCMAKE_TOOLCHAIN_FILE:FILEPATH=toolchain-gcc.cmake -DARCH:STRING=%ARCH% -DREACTOS_BUILD_TOOLS_DIR:PATH="%REACTOS_BUILD_TOOLS_DIR%" "%REACTOS_SOURCE_DIR%"\r
-) else if "%BUILD_ENVIRONMENT%" == "Clang" (\r
- cmake -G %CMAKE_GENERATOR% -DENABLE_CCACHE:BOOL=0 -DCMAKE_TOOLCHAIN_FILE:FILEPATH=toolchain-clang.cmake -DARCH:STRING=%ARCH% -DREACTOS_BUILD_TOOLS_DIR:PATH="%REACTOS_BUILD_TOOLS_DIR%" "%REACTOS_SOURCE_DIR%"\r
+ cmake -G %CMAKE_GENERATOR% -DENABLE_CCACHE:BOOL=0 -DCMAKE_TOOLCHAIN_FILE:FILEPATH=%MINGW_TOOCHAIN_FILE% -DARCH:STRING=%ARCH% -DREACTOS_BUILD_TOOLS_DIR:PATH="%REACTOS_BUILD_TOOLS_DIR%" %* "%REACTOS_SOURCE_DIR%"\r
) else (\r
- cmake -G %CMAKE_GENERATOR% -DCMAKE_TOOLCHAIN_FILE:FILEPATH=toolchain-msvc.cmake -DARCH:STRING=%ARCH% -DREACTOS_BUILD_TOOLS_DIR:PATH="%REACTOS_BUILD_TOOLS_DIR%" "%REACTOS_SOURCE_DIR%"\r
+ cmake -G %CMAKE_GENERATOR% -DCMAKE_TOOLCHAIN_FILE:FILEPATH=toolchain-msvc.cmake -DARCH:STRING=%ARCH% -DREACTOS_BUILD_TOOLS_DIR:PATH="%REACTOS_BUILD_TOOLS_DIR%" -DRUNTIME_CHECKS:BOOL=%VS_RUNTIME_CHECKS% %* "%REACTOS_SOURCE_DIR%"\r
)\r
\r
cd..\r
return RtlEnterCriticalSection(&Lock->CriticalSection);
}
+BOOLEAN
+NTAPI
+RtlTryEnterHeapLock(IN OUT PHEAP_LOCK Lock, IN BOOLEAN Exclusive)
+{
+ UNREFERENCED_PARAMETER(Exclusive);
+
+ return RtlTryEnterCriticalSection(&Lock->CriticalSection);
+}
+
NTSTATUS
NTAPI
RtlInitializeHeapLock(IN OUT PHEAP_LOCK *Lock)
return TRUE;
}
-/*
- * @unimplemented
- */
-BOOL WINAPI
-CreateProcessWithLogonW(LPCWSTR lpUsername,
- LPCWSTR lpDomain,
- LPCWSTR lpPassword,
- DWORD dwLogonFlags,
- LPCWSTR lpApplicationName,
- LPWSTR lpCommandLine,
- DWORD dwCreationFlags,
- LPVOID lpEnvironment,
- LPCWSTR lpCurrentDirectory,
- LPSTARTUPINFOW lpStartupInfo,
- LPPROCESS_INFORMATION lpProcessInformation)
-{
- FIXME("%s %s %s 0x%08x %s %s 0x%08x %p %s %p %p stub\n", debugstr_w(lpUsername), debugstr_w(lpDomain),
- debugstr_w(lpPassword), dwLogonFlags, debugstr_w(lpApplicationName),
- debugstr_w(lpCommandLine), dwCreationFlags, lpEnvironment, debugstr_w(lpCurrentDirectory),
- lpStartupInfo, lpProcessInformation);
-
- return FALSE;
-}
-
/*
* @implemented
*/
#include <advapi32.h>
WINE_DEFAULT_DEBUG_CHANNEL(advapi);
-/* --- ACL --- */
-
-/*
- * @implemented
- */
-BOOL
-WINAPI
-GetAclInformation(PACL pAcl,
- LPVOID pAclInformation,
- DWORD nAclInformationLength,
- ACL_INFORMATION_CLASS dwAclInformationClass)
-{
- NTSTATUS Status;
-
- Status = RtlQueryInformationAcl(pAcl,
- pAclInformation,
- nAclInformationLength,
- dwAclInformationClass);
- if (!NT_SUCCESS(Status))
- {
- SetLastError(RtlNtStatusToDosError(Status));
- return FALSE;
- }
-
- return TRUE;
-}
-
-
-/*
- * @implemented
- */
-BOOL
-WINAPI
-InitializeAcl(PACL pAcl,
- DWORD nAclLength,
- DWORD dwAclRevision)
-{
- NTSTATUS Status;
-
- Status = RtlCreateAcl(pAcl,
- nAclLength,
- dwAclRevision);
- if (!NT_SUCCESS(Status))
- {
- SetLastError(RtlNtStatusToDosError(Status));
- return FALSE;
- }
-
- return TRUE;
-}
-
-
-/*
- * @implemented
- */
-BOOL
-WINAPI
-IsValidAcl(PACL pAcl)
-{
- return RtlValidAcl (pAcl);
-}
-
-
-/*
- * @implemented
- */
-BOOL
-WINAPI
-SetAclInformation(PACL pAcl,
- LPVOID pAclInformation,
- DWORD nAclInformationLength,
- ACL_INFORMATION_CLASS dwAclInformationClass)
-{
- NTSTATUS Status;
-
- Status = RtlSetInformationAcl(pAcl,
- pAclInformation,
- nAclInformationLength,
- dwAclInformationClass);
- if (!NT_SUCCESS(Status))
- {
- SetLastError(RtlNtStatusToDosError(Status));
- return FALSE;
- }
-
- return TRUE;
-}
-
-
/* --- ACE --- */
-/*
- * @implemented
- */
-BOOL
-WINAPI
-AddAccessAllowedAce(PACL pAcl,
- DWORD dwAceRevision,
- DWORD AccessMask,
- PSID pSid)
-{
- NTSTATUS Status;
-
- Status = RtlAddAccessAllowedAce(pAcl,
- dwAceRevision,
- AccessMask,
- pSid);
- if (!NT_SUCCESS(Status))
- {
- SetLastError(RtlNtStatusToDosError(Status));
- return FALSE;
- }
-
- return TRUE;
-}
-
-
-/*
- * @implemented
- */
-BOOL WINAPI
-AddAccessAllowedAceEx(PACL pAcl,
- DWORD dwAceRevision,
- DWORD AceFlags,
- DWORD AccessMask,
- PSID pSid)
-{
- NTSTATUS Status;
-
- Status = RtlAddAccessAllowedAceEx(pAcl,
- dwAceRevision,
- AceFlags,
- AccessMask,
- pSid);
- if (!NT_SUCCESS(Status))
- {
- SetLastError(RtlNtStatusToDosError(Status));
- return FALSE;
- }
-
- return TRUE;
-}
-
-
/*
* @implemented
*/
return TRUE;
}
-
-/*
- * @implemented
- */
-BOOL
-WINAPI
-AddAccessDeniedAce(PACL pAcl,
- DWORD dwAceRevision,
- DWORD AccessMask,
- PSID pSid)
-{
- NTSTATUS Status;
-
- Status = RtlAddAccessDeniedAce(pAcl,
- dwAceRevision,
- AccessMask,
- pSid);
- if (!NT_SUCCESS(Status))
- {
- SetLastError(RtlNtStatusToDosError(Status));
- return FALSE;
- }
-
- return TRUE;
-}
-
-
-/*
- * @implemented
- */
-BOOL WINAPI
-AddAccessDeniedAceEx(PACL pAcl,
- DWORD dwAceRevision,
- DWORD AceFlags,
- DWORD AccessMask,
- PSID pSid)
-{
- NTSTATUS Status;
-
- Status = RtlAddAccessDeniedAceEx(pAcl,
- dwAceRevision,
- AceFlags,
- AccessMask,
- pSid);
- if (!NT_SUCCESS(Status))
- {
- SetLastError(RtlNtStatusToDosError(Status));
- return FALSE;
- }
-
- return TRUE;
-}
-
-
/*
* @implemented
*/
return TRUE;
}
-
-/*
- * @implemented
- */
-BOOL
-WINAPI
-AddAce(PACL pAcl,
- DWORD dwAceRevision,
- DWORD dwStartingAceIndex,
- LPVOID pAceList,
- DWORD nAceListLength)
-{
- NTSTATUS Status;
-
- Status = RtlAddAce(pAcl,
- dwAceRevision,
- dwStartingAceIndex,
- pAceList,
- nAceListLength);
- if (!NT_SUCCESS(Status))
- {
- SetLastError(RtlNtStatusToDosError(Status));
- return FALSE;
- }
-
- return TRUE;
-}
-
-
-/*
- * @implemented
- */
-BOOL
-WINAPI
-AddAuditAccessAce(PACL pAcl,
- DWORD dwAceRevision,
- DWORD dwAccessMask,
- PSID pSid,
- BOOL bAuditSuccess,
- BOOL bAuditFailure)
-{
- NTSTATUS Status;
-
- Status = RtlAddAuditAccessAce(pAcl,
- dwAceRevision,
- dwAccessMask,
- pSid,
- bAuditSuccess,
- bAuditFailure);
- if (!NT_SUCCESS(Status))
- {
- SetLastError(RtlNtStatusToDosError(Status));
- return FALSE;
- }
-
- return TRUE;
-}
-
-
-/*
- * @implemented
- */
-BOOL WINAPI
-AddAuditAccessAceEx(PACL pAcl,
- DWORD dwAceRevision,
- DWORD AceFlags,
- DWORD dwAccessMask,
- PSID pSid,
- BOOL bAuditSuccess,
- BOOL bAuditFailure)
-{
- NTSTATUS Status;
-
- Status = RtlAddAuditAccessAceEx(pAcl,
- dwAceRevision,
- AceFlags,
- dwAccessMask,
- pSid,
- bAuditSuccess,
- bAuditFailure);
- if (!NT_SUCCESS(Status))
- {
- SetLastError(RtlNtStatusToDosError(Status));
- return FALSE;
- }
-
- return TRUE;
-}
-
-
/*
* @implemented
*/
return TRUE;
}
-/*
- * @implemented
- */
-BOOL
-WINAPI
-DeleteAce(PACL pAcl,
- DWORD dwAceIndex)
-{
- NTSTATUS Status;
-
- Status = RtlDeleteAce(pAcl,
- dwAceIndex);
- if (!NT_SUCCESS(Status))
- {
- SetLastError(RtlNtStatusToDosError(Status));
- return FALSE;
- }
-
- return TRUE;
-}
-
-
-/*
- * @implemented
- */
-BOOL
-WINAPI
-FindFirstFreeAce(PACL pAcl,
- LPVOID *pAce)
-{
- return RtlFirstFreeAce(pAcl,
- (PACE*)pAce);
-}
-
-
-/*
- * @implemented
- */
-BOOL
-WINAPI
-GetAce(PACL pAcl,
- DWORD dwAceIndex,
- LPVOID *pAce)
-{
- NTSTATUS Status;
-
- Status = RtlGetAce(pAcl,
- dwAceIndex,
- pAce);
- if (!NT_SUCCESS(Status))
- {
- SetLastError(RtlNtStatusToDosError(Status));
- return FALSE;
- }
-
- return TRUE;
-}
-
-
/*
* @implemented
*/
/******************************************************************************/
-/*
- * @implemented
- */
-BOOL
-WINAPI
-AreAllAccessesGranted(DWORD GrantedAccess,
- DWORD DesiredAccess)
-{
- return (BOOL)RtlAreAllAccessesGranted(GrantedAccess,
- DesiredAccess);
-}
-
-
-/*
- * @implemented
- */
-BOOL
-WINAPI
-AreAnyAccessesGranted(DWORD GrantedAccess,
- DWORD DesiredAccess)
-{
- return (BOOL)RtlAreAnyAccessesGranted(GrantedAccess,
- DesiredAccess);
-}
-
-
-/************************************************************
- * ADVAPI_IsLocalComputer
- *
- * Checks whether the server name indicates local machine.
- */
-BOOL ADVAPI_IsLocalComputer(LPCWSTR ServerName)
-{
- DWORD dwSize = MAX_COMPUTERNAME_LENGTH + 1;
- BOOL Result;
- LPWSTR buf;
-
- if (!ServerName || !ServerName[0])
- return TRUE;
-
- buf = HeapAlloc(GetProcessHeap(), 0, dwSize * sizeof(WCHAR));
- Result = GetComputerNameW(buf, &dwSize);
- if (Result && (ServerName[0] == '\\') && (ServerName[1] == '\\'))
- ServerName += 2;
- Result = Result && !lstrcmpW(ServerName, buf);
- HeapFree(GetProcessHeap(), 0, buf);
-
- return Result;
-}
-
-
-/******************************************************************************
- * GetFileSecurityA [ADVAPI32.@]
- *
- * Obtains Specified information about the security of a file or directory.
- *
- * PARAMS
- * lpFileName [I] Name of the file to get info for
- * RequestedInformation [I] SE_ flags from "winnt.h"
- * pSecurityDescriptor [O] Destination for security information
- * nLength [I] Length of pSecurityDescriptor
- * lpnLengthNeeded [O] Destination for length of returned security information
- *
- * RETURNS
- * Success: TRUE. pSecurityDescriptor contains the requested information.
- * Failure: FALSE. lpnLengthNeeded contains the required space to return the info.
- *
- * NOTES
- * The information returned is constrained by the callers access rights and
- * privileges.
- *
- * @implemented
- */
-BOOL
-WINAPI
-GetFileSecurityA(LPCSTR lpFileName,
- SECURITY_INFORMATION RequestedInformation,
- PSECURITY_DESCRIPTOR pSecurityDescriptor,
- DWORD nLength,
- LPDWORD lpnLengthNeeded)
-{
- UNICODE_STRING FileName;
- BOOL bResult;
-
- if (!RtlCreateUnicodeStringFromAsciiz(&FileName, lpFileName))
- {
- SetLastError(ERROR_NOT_ENOUGH_MEMORY);
- return FALSE;
- }
-
- bResult = GetFileSecurityW(FileName.Buffer,
- RequestedInformation,
- pSecurityDescriptor,
- nLength,
- lpnLengthNeeded);
-
- RtlFreeUnicodeString(&FileName);
-
- return bResult;
-}
-
-
-/*
- * @implemented
- */
-BOOL
-WINAPI
-GetFileSecurityW(LPCWSTR lpFileName,
- SECURITY_INFORMATION RequestedInformation,
- PSECURITY_DESCRIPTOR pSecurityDescriptor,
- DWORD nLength,
- LPDWORD lpnLengthNeeded)
-{
- OBJECT_ATTRIBUTES ObjectAttributes;
- IO_STATUS_BLOCK StatusBlock;
- UNICODE_STRING FileName;
- ULONG AccessMask = 0;
- HANDLE FileHandle;
- NTSTATUS Status;
-
- TRACE("GetFileSecurityW() called\n");
-
- QuerySecurityAccessMask(RequestedInformation, &AccessMask);
-
- if (!RtlDosPathNameToNtPathName_U(lpFileName,
- &FileName,
- NULL,
- NULL))
- {
- ERR("Invalid path\n");
- SetLastError(ERROR_INVALID_NAME);
- return FALSE;
- }
-
- InitializeObjectAttributes(&ObjectAttributes,
- &FileName,
- OBJ_CASE_INSENSITIVE,
- NULL,
- NULL);
-
- Status = NtOpenFile(&FileHandle,
- AccessMask,
- &ObjectAttributes,
- &StatusBlock,
- FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE,
- 0);
-
- RtlFreeHeap(RtlGetProcessHeap(),
- 0,
- FileName.Buffer);
-
- if (!NT_SUCCESS(Status))
- {
- ERR("NtOpenFile() failed (Status %lx)\n", Status);
- SetLastError(RtlNtStatusToDosError(Status));
- return FALSE;
- }
-
- Status = NtQuerySecurityObject(FileHandle,
- RequestedInformation,
- pSecurityDescriptor,
- nLength,
- lpnLengthNeeded);
- NtClose(FileHandle);
- if (!NT_SUCCESS(Status))
- {
- ERR("NtQuerySecurityObject() failed (Status %lx)\n", Status);
- SetLastError(RtlNtStatusToDosError(Status));
- return FALSE;
- }
-
- return TRUE;
-}
-
-
-/*
- * @implemented
- */
-BOOL
-WINAPI
-GetKernelObjectSecurity(HANDLE Handle,
- SECURITY_INFORMATION RequestedInformation,
- PSECURITY_DESCRIPTOR pSecurityDescriptor,
- DWORD nLength,
- LPDWORD lpnLengthNeeded)
-{
- NTSTATUS Status;
-
- Status = NtQuerySecurityObject(Handle,
- RequestedInformation,
- pSecurityDescriptor,
- nLength,
- lpnLengthNeeded);
- if (!NT_SUCCESS(Status))
- {
- SetLastError(RtlNtStatusToDosError(Status));
- return FALSE;
- }
-
- return TRUE;
-}
-
-
-/******************************************************************************
- * SetFileSecurityA [ADVAPI32.@]
- * Sets the security of a file or directory
- *
- * @implemented
- */
-BOOL
-WINAPI
-SetFileSecurityA(LPCSTR lpFileName,
- SECURITY_INFORMATION SecurityInformation,
- PSECURITY_DESCRIPTOR pSecurityDescriptor)
-{
- UNICODE_STRING FileName;
- BOOL bResult;
-
- if (!RtlCreateUnicodeStringFromAsciiz(&FileName, lpFileName))
- {
- SetLastError(ERROR_NOT_ENOUGH_MEMORY);
- return FALSE;
- }
-
- bResult = SetFileSecurityW(FileName.Buffer,
- SecurityInformation,
- pSecurityDescriptor);
-
- RtlFreeUnicodeString(&FileName);
-
- return bResult;
-}
-
-
-/******************************************************************************
- * SetFileSecurityW [ADVAPI32.@]
- * Sets the security of a file or directory
- *
- * @implemented
- */
-BOOL
-WINAPI
-SetFileSecurityW(LPCWSTR lpFileName,
- SECURITY_INFORMATION SecurityInformation,
- PSECURITY_DESCRIPTOR pSecurityDescriptor)
-{
- OBJECT_ATTRIBUTES ObjectAttributes;
- IO_STATUS_BLOCK StatusBlock;
- UNICODE_STRING FileName;
- ULONG AccessMask = 0;
- HANDLE FileHandle;
- NTSTATUS Status;
-
- TRACE("SetFileSecurityW() called\n");
-
- SetSecurityAccessMask(SecurityInformation, &AccessMask);
-
- if (!RtlDosPathNameToNtPathName_U(lpFileName,
- &FileName,
- NULL,
- NULL))
- {
- ERR("Invalid path\n");
- SetLastError(ERROR_INVALID_NAME);
- return FALSE;
- }
-
- InitializeObjectAttributes(&ObjectAttributes,
- &FileName,
- OBJ_CASE_INSENSITIVE,
- NULL,
- NULL);
-
- Status = NtOpenFile(&FileHandle,
- AccessMask,
- &ObjectAttributes,
- &StatusBlock,
- FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE,
- 0);
-
- RtlFreeHeap(RtlGetProcessHeap(),
- 0,
- FileName.Buffer);
-
- if (!NT_SUCCESS(Status))
- {
- ERR("NtOpenFile() failed (Status %lx)\n", Status);
- SetLastError(RtlNtStatusToDosError(Status));
- return FALSE;
- }
-
- Status = NtSetSecurityObject(FileHandle,
- SecurityInformation,
- pSecurityDescriptor);
- NtClose(FileHandle);
-
- if (!NT_SUCCESS(Status))
- {
- ERR("NtSetSecurityObject() failed (Status %lx)\n", Status);
- SetLastError(RtlNtStatusToDosError(Status));
- return FALSE;
- }
-
- return TRUE;
-}
-
-
-/*
- * @implemented
- */
-BOOL
-WINAPI
-SetKernelObjectSecurity(HANDLE Handle,
- SECURITY_INFORMATION SecurityInformation,
- PSECURITY_DESCRIPTOR SecurityDescriptor)
-{
- NTSTATUS Status;
-
- Status = NtSetSecurityObject(Handle,
- SecurityInformation,
- SecurityDescriptor);
- if (!NT_SUCCESS(Status))
- {
- SetLastError(RtlNtStatusToDosError(Status));
- return FALSE;
- }
-
- return TRUE;
-}
-
-
/*
* @implemented
*/
return TRUE;
}
-
/*
* @implemented
*/
return TRUE;
}
-
-/*
- * @implemented
- */
-BOOL
-WINAPI
-ImpersonateSelf(SECURITY_IMPERSONATION_LEVEL ImpersonationLevel)
-{
- NTSTATUS Status;
-
- Status = RtlImpersonateSelf(ImpersonationLevel);
- if (!NT_SUCCESS(Status))
- {
- SetLastError(RtlNtStatusToDosError(Status));
- return FALSE;
- }
-
- return TRUE;
-}
-
-
-/*
- * @implemented
- */
-BOOL
-WINAPI
-RevertToSelf(VOID)
-{
- NTSTATUS Status;
- HANDLE Token = NULL;
-
- Status = NtSetInformationThread(NtCurrentThread(),
- ThreadImpersonationToken,
- &Token,
- sizeof(HANDLE));
- if (!NT_SUCCESS(Status))
- {
- SetLastError(RtlNtStatusToDosError(Status));
- return FALSE;
- }
-
- return TRUE;
-}
-
-
/******************************************************************************
* GetUserNameA [ADVAPI32.@]
*
return Ret;
}
-
/******************************************************************************
* GetUserNameW [ADVAPI32.@]
*
return ret;
}
-
-/******************************************************************************
- * LookupAccountNameA [ADVAPI32.@]
- *
- * @implemented
- */
-BOOL
-WINAPI
-LookupAccountNameA(LPCSTR SystemName,
- LPCSTR AccountName,
- PSID Sid,
- LPDWORD SidLength,
- LPSTR ReferencedDomainName,
- LPDWORD hReferencedDomainNameLength,
- PSID_NAME_USE SidNameUse)
-{
- BOOL ret;
- UNICODE_STRING lpSystemW;
- UNICODE_STRING lpAccountW;
- LPWSTR lpReferencedDomainNameW = NULL;
-
- RtlCreateUnicodeStringFromAsciiz(&lpSystemW, SystemName);
- RtlCreateUnicodeStringFromAsciiz(&lpAccountW, AccountName);
-
- if (ReferencedDomainName)
- lpReferencedDomainNameW = HeapAlloc(GetProcessHeap(),
- 0,
- *hReferencedDomainNameLength * sizeof(WCHAR));
-
- ret = LookupAccountNameW(lpSystemW.Buffer,
- lpAccountW.Buffer,
- Sid,
- SidLength,
- lpReferencedDomainNameW,
- hReferencedDomainNameLength,
- SidNameUse);
-
- if (ret && lpReferencedDomainNameW)
- {
- WideCharToMultiByte(CP_ACP,
- 0,
- lpReferencedDomainNameW,
- *hReferencedDomainNameLength + 1,
- ReferencedDomainName,
- *hReferencedDomainNameLength + 1,
- NULL,
- NULL);
- }
-
- RtlFreeUnicodeString(&lpSystemW);
- RtlFreeUnicodeString(&lpAccountW);
- HeapFree(GetProcessHeap(), 0, lpReferencedDomainNameW);
-
- return ret;
-}
-
-
/******************************************************************************
* LookupAccountNameW [ADVAPI32.@]
*
return TRUE;
}
-
-/**********************************************************************
- * LookupPrivilegeDisplayNameA EXPORTED
- *
- * @unimplemented
- */
-BOOL
-WINAPI
-LookupPrivilegeDisplayNameA(LPCSTR lpSystemName,
- LPCSTR lpName,
- LPSTR lpDisplayName,
- LPDWORD cbDisplayName,
- LPDWORD lpLanguageId)
-{
- FIXME("%s() not implemented!\n", __FUNCTION__);
- SetLastError (ERROR_CALL_NOT_IMPLEMENTED);
- return FALSE;
-}
-
-
-/**********************************************************************
- * LookupPrivilegeDisplayNameW EXPORTED
- *
- * @unimplemented
- */
-BOOL
-WINAPI
-LookupPrivilegeDisplayNameW(LPCWSTR lpSystemName,
- LPCWSTR lpName,
- LPWSTR lpDisplayName,
- LPDWORD cbDisplayName,
- LPDWORD lpLanguageId)
-{
- FIXME("%s() not implemented!\n", __FUNCTION__);
- SetLastError (ERROR_CALL_NOT_IMPLEMENTED);
- return FALSE;
-}
-
-
-/**********************************************************************
- * LookupPrivilegeNameA EXPORTED
- *
- * @implemented
- */
-BOOL
-WINAPI
-LookupPrivilegeNameA(LPCSTR lpSystemName,
- PLUID lpLuid,
- LPSTR lpName,
- LPDWORD cchName)
-{
- UNICODE_STRING lpSystemNameW;
- BOOL ret;
- DWORD wLen = 0;
-
- TRACE("%s %p %p %p\n", debugstr_a(lpSystemName), lpLuid, lpName, cchName);
-
- RtlCreateUnicodeStringFromAsciiz(&lpSystemNameW, lpSystemName);
- ret = LookupPrivilegeNameW(lpSystemNameW.Buffer, lpLuid, NULL, &wLen);
- if (!ret && GetLastError() == ERROR_INSUFFICIENT_BUFFER)
- {
- LPWSTR lpNameW = HeapAlloc(GetProcessHeap(), 0, wLen * sizeof(WCHAR));
-
- ret = LookupPrivilegeNameW(lpSystemNameW.Buffer, lpLuid, lpNameW,
- &wLen);
- if (ret)
- {
- /* Windows crashes if cchName is NULL, so will I */
- unsigned int len = WideCharToMultiByte(CP_ACP, 0, lpNameW, -1, lpName,
- *cchName, NULL, NULL);
-
- if (len == 0)
- {
- /* WideCharToMultiByte failed */
- ret = FALSE;
- }
- else if (len > *cchName)
- {
- *cchName = len;
- SetLastError(ERROR_INSUFFICIENT_BUFFER);
- ret = FALSE;
- }
- else
- {
- /* WideCharToMultiByte succeeded, output length needs to be
- * length not including NULL terminator
- */
- *cchName = len - 1;
- }
- }
- HeapFree(GetProcessHeap(), 0, lpNameW);
- }
- RtlFreeUnicodeString(&lpSystemNameW);
- return ret;
-}
-
-
/**********************************************************************
* LookupPrivilegeNameW EXPORTED
*
return ErrorCode;
}
-
-/**********************************************************************
- * GetNamedSecurityInfoA EXPORTED
- *
- * @implemented
- */
-DWORD
-WINAPI
-GetNamedSecurityInfoA(LPSTR pObjectName,
- SE_OBJECT_TYPE ObjectType,
- SECURITY_INFORMATION SecurityInfo,
- PSID *ppsidOwner,
- PSID *ppsidGroup,
- PACL *ppDacl,
- PACL *ppSacl,
- PSECURITY_DESCRIPTOR *ppSecurityDescriptor)
-{
- DWORD len;
- LPWSTR wstr = NULL;
- DWORD r;
-
- TRACE("%s %d %d %p %p %p %p %p\n", pObjectName, ObjectType, SecurityInfo,
- ppsidOwner, ppsidGroup, ppDacl, ppSacl, ppSecurityDescriptor);
-
- if( pObjectName )
- {
- len = MultiByteToWideChar( CP_ACP, 0, pObjectName, -1, NULL, 0 );
- wstr = HeapAlloc( GetProcessHeap(), 0, len*sizeof(WCHAR));
- MultiByteToWideChar( CP_ACP, 0, pObjectName, -1, wstr, len );
- }
-
- r = GetNamedSecurityInfoW( wstr, ObjectType, SecurityInfo, ppsidOwner,
- ppsidGroup, ppDacl, ppSacl, ppSecurityDescriptor );
-
- HeapFree( GetProcessHeap(), 0, wstr );
-
- return r;
-}
-
-
/**********************************************************************
* SetNamedSecurityInfoW EXPORTED
*
return ErrorCode;
}
-
-/**********************************************************************
- * SetNamedSecurityInfoA EXPORTED
- *
- * @implemented
- */
-DWORD
-WINAPI
-SetNamedSecurityInfoA(LPSTR pObjectName,
- SE_OBJECT_TYPE ObjectType,
- SECURITY_INFORMATION SecurityInfo,
- PSID psidOwner,
- PSID psidGroup,
- PACL pDacl,
- PACL pSacl)
-{
- UNICODE_STRING ObjectName;
- DWORD Ret;
-
- if (!RtlCreateUnicodeStringFromAsciiz(&ObjectName, pObjectName))
- {
- return ERROR_NOT_ENOUGH_MEMORY;
- }
-
- Ret = SetNamedSecurityInfoW(ObjectName.Buffer,
- ObjectType,
- SecurityInfo,
- psidOwner,
- psidGroup,
- pDacl,
- pSacl);
-
- RtlFreeUnicodeString(&ObjectName);
-
- return Ret;
-}
-
-
/**********************************************************************
* GetSecurityInfo EXPORTED
*
return ErrorCode;
}
-
-/******************************************************************************
- * GetSecurityInfoExW EXPORTED
- */
-DWORD
-WINAPI
-GetSecurityInfoExA(HANDLE hObject,
- SE_OBJECT_TYPE ObjectType,
- SECURITY_INFORMATION SecurityInfo,
- LPCSTR lpProvider,
- LPCSTR lpProperty,
- PACTRL_ACCESSA *ppAccessList,
- PACTRL_AUDITA *ppAuditList,
- LPSTR *lppOwner,
- LPSTR *lppGroup)
-{
- FIXME("%s() not implemented!\n", __FUNCTION__);
- return ERROR_BAD_PROVIDER;
-}
-
-
-/******************************************************************************
- * GetSecurityInfoExW EXPORTED
- */
-DWORD
-WINAPI
-GetSecurityInfoExW(HANDLE hObject,
- SE_OBJECT_TYPE ObjectType,
- SECURITY_INFORMATION SecurityInfo,
- LPCWSTR lpProvider,
- LPCWSTR lpProperty,
- PACTRL_ACCESSW *ppAccessList,
- PACTRL_AUDITW *ppAuditList,
- LPWSTR *lppOwner,
- LPWSTR *lppGroup)
-{
- FIXME("%s() not implemented!\n", __FUNCTION__);
- return ERROR_BAD_PROVIDER;
-}
-
-
-/**********************************************************************
- * ImpersonateNamedPipeClient EXPORTED
- *
- * @implemented
- */
-BOOL
-WINAPI
-ImpersonateNamedPipeClient(HANDLE hNamedPipe)
-{
- IO_STATUS_BLOCK StatusBlock;
- NTSTATUS Status;
-
- TRACE("ImpersonateNamedPipeClient() called\n");
-
- Status = NtFsControlFile(hNamedPipe,
- NULL,
- NULL,
- NULL,
- &StatusBlock,
- FSCTL_PIPE_IMPERSONATE,
- NULL,
- 0,
- NULL,
- 0);
- if (!NT_SUCCESS(Status))
- {
- SetLastError(RtlNtStatusToDosError(Status));
- return FALSE;
- }
-
- return TRUE;
-}
-
-
/*
* @implemented
*/
#endif
}
-/******************************************************************************
- * QueryWindows31FilesMigration [ADVAPI32.@]
- *
- * PARAMS
- * x1 []
- */
-BOOL WINAPI
-QueryWindows31FilesMigration( DWORD x1 )
-{
- FIXME("(%d):stub\n",x1);
- return TRUE;
-}
-
-/******************************************************************************
- * SynchronizeWindows31FilesAndWindowsNTRegistry [ADVAPI32.@]
- *
- * PARAMS
- * x1 []
- * x2 []
- * x3 []
- * x4 []
- */
-BOOL WINAPI
-SynchronizeWindows31FilesAndWindowsNTRegistry( DWORD x1, DWORD x2, DWORD x3,
- DWORD x4 )
-{
- FIXME("(0x%08x,0x%08x,0x%08x,0x%08x):stub\n",x1,x2,x3,x4);
- return TRUE;
-}
-
/* EOF */
return TRUE;
}
-
-/*
- * @implemented
- */
-BOOL
-WINAPI
-InitializeSecurityDescriptor(PSECURITY_DESCRIPTOR pSecurityDescriptor,
- DWORD dwRevision)
-{
- NTSTATUS Status;
-
- Status = RtlCreateSecurityDescriptor(pSecurityDescriptor,
- dwRevision);
- if (!NT_SUCCESS(Status))
- {
- SetLastError(RtlNtStatusToDosError(Status));
- return FALSE;
- }
-
- return TRUE;
-}
-
-
/*
* @implemented
*/
return (BOOL)Result;
}
-
-/*
- * @implemented
- */
-BOOL
-WINAPI
-MakeAbsoluteSD(PSECURITY_DESCRIPTOR pSelfRelativeSecurityDescriptor,
- PSECURITY_DESCRIPTOR pAbsoluteSecurityDescriptor,
- LPDWORD lpdwAbsoluteSecurityDescriptorSize,
- PACL pDacl,
- LPDWORD lpdwDaclSize,
- PACL pSacl,
- LPDWORD lpdwSaclSize,
- PSID pOwner,
- LPDWORD lpdwOwnerSize,
- PSID pPrimaryGroup,
- LPDWORD lpdwPrimaryGroupSize)
-{
- NTSTATUS Status;
-
- Status = RtlSelfRelativeToAbsoluteSD(pSelfRelativeSecurityDescriptor,
- pAbsoluteSecurityDescriptor,
- lpdwAbsoluteSecurityDescriptorSize,
- pDacl,
- lpdwDaclSize,
- pSacl,
- lpdwSaclSize,
- pOwner,
- lpdwOwnerSize,
- pPrimaryGroup,
- lpdwPrimaryGroupSize);
- if (!NT_SUCCESS(Status))
- {
- SetLastError(RtlNtStatusToDosError(Status));
- return FALSE;
- }
-
- return TRUE;
-}
-
-
/*
* @implemented
*/
pTrustee->MultipleTrusteeOperation = TRUSTEE_IS_IMPERSONATE;
}
-
-/******************************************************************************
- * BuildExplicitAccessWithNameA [ADVAPI32.@]
- */
-VOID WINAPI
-BuildExplicitAccessWithNameA(PEXPLICIT_ACCESSA pExplicitAccess,
- LPSTR pTrusteeName,
- DWORD AccessPermissions,
- ACCESS_MODE AccessMode,
- DWORD Inheritance)
-{
- pExplicitAccess->grfAccessPermissions = AccessPermissions;
- pExplicitAccess->grfAccessMode = AccessMode;
- pExplicitAccess->grfInheritance = Inheritance;
-
- pExplicitAccess->Trustee.pMultipleTrustee = NULL;
- pExplicitAccess->Trustee.MultipleTrusteeOperation = NO_MULTIPLE_TRUSTEE;
- pExplicitAccess->Trustee.TrusteeForm = TRUSTEE_IS_NAME;
- pExplicitAccess->Trustee.TrusteeType = TRUSTEE_IS_UNKNOWN;
- pExplicitAccess->Trustee.ptstrName = pTrusteeName;
-}
-
-
-/******************************************************************************
- * BuildExplicitAccessWithNameW [ADVAPI32.@]
- */
-VOID WINAPI
-BuildExplicitAccessWithNameW(PEXPLICIT_ACCESSW pExplicitAccess,
- LPWSTR pTrusteeName,
- DWORD AccessPermissions,
- ACCESS_MODE AccessMode,
- DWORD Inheritance)
-{
- pExplicitAccess->grfAccessPermissions = AccessPermissions;
- pExplicitAccess->grfAccessMode = AccessMode;
- pExplicitAccess->grfInheritance = Inheritance;
-
- pExplicitAccess->Trustee.pMultipleTrustee = NULL;
- pExplicitAccess->Trustee.MultipleTrusteeOperation = NO_MULTIPLE_TRUSTEE;
- pExplicitAccess->Trustee.TrusteeForm = TRUSTEE_IS_NAME;
- pExplicitAccess->Trustee.TrusteeType = TRUSTEE_IS_UNKNOWN;
- pExplicitAccess->Trustee.ptstrName = pTrusteeName;
-}
-
-
/******************************************************************************
* BuildImpersonateExplicitAccessWithNameA [ADVAPI32.@]
*/
pExplicitAccess->Trustee.ptstrName = pTrusteeName;
}
-
-/******************************************************************************
- * BuildTrusteeWithSidA [ADVAPI32.@]
- */
-VOID WINAPI
-BuildTrusteeWithSidA(PTRUSTEE_A pTrustee,
- PSID pSid)
-{
- TRACE("%p %p\n", pTrustee, pSid);
-
- pTrustee->pMultipleTrustee = NULL;
- pTrustee->MultipleTrusteeOperation = NO_MULTIPLE_TRUSTEE;
- pTrustee->TrusteeForm = TRUSTEE_IS_SID;
- pTrustee->TrusteeType = TRUSTEE_IS_UNKNOWN;
- pTrustee->ptstrName = (LPSTR) pSid;
-}
-
-
-/******************************************************************************
- * BuildTrusteeWithSidW [ADVAPI32.@]
- */
-VOID WINAPI
-BuildTrusteeWithSidW(PTRUSTEE_W pTrustee,
- PSID pSid)
-{
- TRACE("%p %p\n", pTrustee, pSid);
-
- pTrustee->pMultipleTrustee = NULL;
- pTrustee->MultipleTrusteeOperation = NO_MULTIPLE_TRUSTEE;
- pTrustee->TrusteeForm = TRUSTEE_IS_SID;
- pTrustee->TrusteeType = TRUSTEE_IS_UNKNOWN;
- pTrustee->ptstrName = (LPWSTR) pSid;
-}
-
-
-/******************************************************************************
- * BuildTrusteeWithNameA [ADVAPI32.@]
- */
-VOID WINAPI
-BuildTrusteeWithNameA(PTRUSTEE_A pTrustee,
- LPSTR name)
-{
- TRACE("%p %s\n", pTrustee, name);
-
- pTrustee->pMultipleTrustee = NULL;
- pTrustee->MultipleTrusteeOperation = NO_MULTIPLE_TRUSTEE;
- pTrustee->TrusteeForm = TRUSTEE_IS_NAME;
- pTrustee->TrusteeType = TRUSTEE_IS_UNKNOWN;
- pTrustee->ptstrName = name;
-}
-
-
-/******************************************************************************
- * BuildTrusteeWithNameW [ADVAPI32.@]
- */
-VOID WINAPI
-BuildTrusteeWithNameW(PTRUSTEE_W pTrustee,
- LPWSTR name)
-{
- TRACE("%p %s\n", pTrustee, name);
-
- pTrustee->pMultipleTrustee = NULL;
- pTrustee->MultipleTrusteeOperation = NO_MULTIPLE_TRUSTEE;
- pTrustee->TrusteeForm = TRUSTEE_IS_NAME;
- pTrustee->TrusteeType = TRUSTEE_IS_UNKNOWN;
- pTrustee->ptstrName = name;
-}
-
-
-/******************************************************************************
- * BuildTrusteeWithObjectsAndNameA [ADVAPI32.@]
- */
-VOID WINAPI
-BuildTrusteeWithObjectsAndNameA(PTRUSTEEA pTrustee,
- POBJECTS_AND_NAME_A pObjName,
- SE_OBJECT_TYPE ObjectType,
- LPSTR ObjectTypeName,
- LPSTR InheritedObjectTypeName,
- LPSTR Name)
-{
- DWORD ObjectsPresent = 0;
-
- TRACE("%p %p 0x%08x %p %p %s\n", pTrustee, pObjName,
- ObjectType, ObjectTypeName, InheritedObjectTypeName, Name);
-
- /* Fill the OBJECTS_AND_NAME structure */
- pObjName->ObjectType = ObjectType;
- if (ObjectTypeName != NULL)
- {
- ObjectsPresent |= ACE_OBJECT_TYPE_PRESENT;
- }
-
- pObjName->InheritedObjectTypeName = InheritedObjectTypeName;
- if (InheritedObjectTypeName != NULL)
- {
- ObjectsPresent |= ACE_INHERITED_OBJECT_TYPE_PRESENT;
- }
-
- pObjName->ObjectsPresent = ObjectsPresent;
- pObjName->ptstrName = Name;
-
- /* Fill the TRUSTEE structure */
- pTrustee->pMultipleTrustee = NULL;
- pTrustee->MultipleTrusteeOperation = NO_MULTIPLE_TRUSTEE;
- pTrustee->TrusteeForm = TRUSTEE_IS_OBJECTS_AND_NAME;
- pTrustee->TrusteeType = TRUSTEE_IS_UNKNOWN;
- pTrustee->ptstrName = (LPSTR)pObjName;
-}
-
-
-/******************************************************************************
- * BuildTrusteeWithObjectsAndNameW [ADVAPI32.@]
- */
-VOID WINAPI
-BuildTrusteeWithObjectsAndNameW(PTRUSTEEW pTrustee,
- POBJECTS_AND_NAME_W pObjName,
- SE_OBJECT_TYPE ObjectType,
- LPWSTR ObjectTypeName,
- LPWSTR InheritedObjectTypeName,
- LPWSTR Name)
-{
- DWORD ObjectsPresent = 0;
-
- TRACE("%p %p 0x%08x %p %p %s\n", pTrustee, pObjName,
- ObjectType, ObjectTypeName, InheritedObjectTypeName, Name);
-
- /* Fill the OBJECTS_AND_NAME structure */
- pObjName->ObjectType = ObjectType;
- if (ObjectTypeName != NULL)
- {
- ObjectsPresent |= ACE_OBJECT_TYPE_PRESENT;
- }
-
- pObjName->InheritedObjectTypeName = InheritedObjectTypeName;
- if (InheritedObjectTypeName != NULL)
- {
- ObjectsPresent |= ACE_INHERITED_OBJECT_TYPE_PRESENT;
- }
-
- pObjName->ObjectsPresent = ObjectsPresent;
- pObjName->ptstrName = Name;
-
- /* Fill the TRUSTEE structure */
- pTrustee->pMultipleTrustee = NULL;
- pTrustee->MultipleTrusteeOperation = NO_MULTIPLE_TRUSTEE;
- pTrustee->TrusteeForm = TRUSTEE_IS_OBJECTS_AND_NAME;
- pTrustee->TrusteeType = TRUSTEE_IS_UNKNOWN;
- pTrustee->ptstrName = (LPWSTR)pObjName;
-}
-
-
-/******************************************************************************
- * BuildTrusteeWithObjectsAndSidA [ADVAPI32.@]
- */
-VOID WINAPI
-BuildTrusteeWithObjectsAndSidA(PTRUSTEEA pTrustee,
- POBJECTS_AND_SID pObjSid,
- GUID *pObjectGuid,
- GUID *pInheritedObjectGuid,
- PSID pSid)
-{
- DWORD ObjectsPresent = 0;
-
- TRACE("%p %p %p %p %p\n", pTrustee, pObjSid, pObjectGuid, pInheritedObjectGuid, pSid);
-
- /* Fill the OBJECTS_AND_SID structure */
- if (pObjectGuid != NULL)
- {
- pObjSid->ObjectTypeGuid = *pObjectGuid;
- ObjectsPresent |= ACE_OBJECT_TYPE_PRESENT;
- }
- else
- {
- ZeroMemory(&pObjSid->ObjectTypeGuid,
- sizeof(GUID));
- }
-
- if (pInheritedObjectGuid != NULL)
- {
- pObjSid->InheritedObjectTypeGuid = *pInheritedObjectGuid;
- ObjectsPresent |= ACE_INHERITED_OBJECT_TYPE_PRESENT;
- }
- else
- {
- ZeroMemory(&pObjSid->InheritedObjectTypeGuid,
- sizeof(GUID));
- }
-
- pObjSid->ObjectsPresent = ObjectsPresent;
- pObjSid->pSid = pSid;
-
- /* Fill the TRUSTEE structure */
- pTrustee->pMultipleTrustee = NULL;
- pTrustee->MultipleTrusteeOperation = NO_MULTIPLE_TRUSTEE;
- pTrustee->TrusteeForm = TRUSTEE_IS_OBJECTS_AND_SID;
- pTrustee->TrusteeType = TRUSTEE_IS_UNKNOWN;
- pTrustee->ptstrName = (LPSTR) pObjSid;
-}
-
-
-/******************************************************************************
- * BuildTrusteeWithObjectsAndSidW [ADVAPI32.@]
- */
-VOID WINAPI
-BuildTrusteeWithObjectsAndSidW(PTRUSTEEW pTrustee,
- POBJECTS_AND_SID pObjSid,
- GUID *pObjectGuid,
- GUID *pInheritedObjectGuid,
- PSID pSid)
-{
- DWORD ObjectsPresent = 0;
-
- TRACE("%p %p %p %p %p\n", pTrustee, pObjSid, pObjectGuid, pInheritedObjectGuid, pSid);
-
- /* Fill the OBJECTS_AND_SID structure */
- if (pObjectGuid != NULL)
- {
- pObjSid->ObjectTypeGuid = *pObjectGuid;
- ObjectsPresent |= ACE_OBJECT_TYPE_PRESENT;
- }
- else
- {
- ZeroMemory(&pObjSid->ObjectTypeGuid,
- sizeof(GUID));
- }
-
- if (pInheritedObjectGuid != NULL)
- {
- pObjSid->InheritedObjectTypeGuid = *pInheritedObjectGuid;
- ObjectsPresent |= ACE_INHERITED_OBJECT_TYPE_PRESENT;
- }
- else
- {
- ZeroMemory(&pObjSid->InheritedObjectTypeGuid,
- sizeof(GUID));
- }
-
- pObjSid->ObjectsPresent = ObjectsPresent;
- pObjSid->pSid = pSid;
-
- /* Fill the TRUSTEE structure */
- pTrustee->pMultipleTrustee = NULL;
- pTrustee->MultipleTrusteeOperation = NO_MULTIPLE_TRUSTEE;
- pTrustee->TrusteeForm = TRUSTEE_IS_OBJECTS_AND_SID;
- pTrustee->TrusteeType = TRUSTEE_IS_UNKNOWN;
- pTrustee->ptstrName = (LPWSTR) pObjSid;
-}
-
-
/******************************************************************************
* GetMultipleTrusteeA [ADVAPI32.@]
*/
return pTrustee->MultipleTrusteeOperation;
}
-
-/******************************************************************************
- * GetTrusteeFormW [ADVAPI32.@]
- */
-TRUSTEE_FORM WINAPI
-GetTrusteeFormA(PTRUSTEE_A pTrustee)
-{
- return pTrustee->TrusteeForm;
-}
-
-
-/******************************************************************************
- * GetTrusteeFormW [ADVAPI32.@]
- */
-TRUSTEE_FORM WINAPI
-GetTrusteeFormW(PTRUSTEE_W pTrustee)
-{
- return pTrustee->TrusteeForm;
-}
-
-
-/******************************************************************************
- * GetTrusteeNameA [ADVAPI32.@]
- */
-LPSTR WINAPI
-GetTrusteeNameA(PTRUSTEE_A pTrustee)
-{
- return pTrustee->ptstrName;
-}
-
-
-/******************************************************************************
- * GetTrusteeNameW [ADVAPI32.@]
- */
-LPWSTR WINAPI
-GetTrusteeNameW(PTRUSTEE_W pTrustee)
-{
- return pTrustee->ptstrName;
-}
-
-
-/******************************************************************************
- * GetTrusteeTypeA [ADVAPI32.@]
- */
-TRUSTEE_TYPE WINAPI
-GetTrusteeTypeA(PTRUSTEE_A pTrustee)
-{
- return pTrustee->TrusteeType;
-}
-
-
-/******************************************************************************
- * GetTrusteeTypeW [ADVAPI32.@]
- */
-TRUSTEE_TYPE WINAPI
-GetTrusteeTypeW(PTRUSTEE_W pTrustee)
-{
- return pTrustee->TrusteeType;
-}
-
/* EOF */
WINE_DEFAULT_DEBUG_CHANNEL(advapi);
-/*
- * @implemented
- */
-BOOL WINAPI
-AdjustTokenGroups(HANDLE TokenHandle,
- BOOL ResetToDefault,
- PTOKEN_GROUPS NewState,
- DWORD BufferLength,
- PTOKEN_GROUPS PreviousState,
- PDWORD ReturnLength)
-{
- NTSTATUS Status;
-
- Status = NtAdjustGroupsToken(TokenHandle,
- ResetToDefault,
- NewState,
- BufferLength,
- PreviousState,
- (PULONG)ReturnLength);
- if (!NT_SUCCESS(Status))
- {
- SetLastError(RtlNtStatusToDosError(Status));
- return FALSE;
- }
-
- return TRUE;
-}
-
-
-/*
- * @implemented
- */
-BOOL WINAPI
-AdjustTokenPrivileges(HANDLE TokenHandle,
- BOOL DisableAllPrivileges,
- PTOKEN_PRIVILEGES NewState,
- DWORD BufferLength,
- PTOKEN_PRIVILEGES PreviousState,
- PDWORD ReturnLength)
-{
- NTSTATUS Status;
-
- Status = NtAdjustPrivilegesToken(TokenHandle,
- DisableAllPrivileges,
- NewState,
- BufferLength,
- PreviousState,
- (PULONG)ReturnLength);
- if (STATUS_NOT_ALL_ASSIGNED == Status)
- {
- SetLastError(ERROR_NOT_ALL_ASSIGNED);
- return TRUE;
- }
-
- if (!NT_SUCCESS(Status))
- {
- SetLastError(RtlNtStatusToDosError(Status));
- return FALSE;
- }
-
- /* AdjustTokenPrivileges is documented to do this */
- SetLastError(ERROR_SUCCESS);
-
- return TRUE;
-}
-
-
-/*
- * @implemented
- */
-BOOL WINAPI
-GetTokenInformation(HANDLE TokenHandle,
- TOKEN_INFORMATION_CLASS TokenInformationClass,
- LPVOID TokenInformation,
- DWORD TokenInformationLength,
- PDWORD ReturnLength)
-{
- NTSTATUS Status;
-
- Status = NtQueryInformationToken(TokenHandle,
- TokenInformationClass,
- TokenInformation,
- TokenInformationLength,
- (PULONG)ReturnLength);
- if (!NT_SUCCESS(Status))
- {
- SetLastError(RtlNtStatusToDosError(Status));
- return FALSE;
- }
-
- return TRUE;
-}
-
-
-/*
- * @implemented
- */
-BOOL WINAPI
-SetTokenInformation(HANDLE TokenHandle,
- TOKEN_INFORMATION_CLASS TokenInformationClass,
- LPVOID TokenInformation,
- DWORD TokenInformationLength)
-{
- NTSTATUS Status;
-
- Status = NtSetInformationToken(TokenHandle,
- TokenInformationClass,
- TokenInformation,
- TokenInformationLength);
- if (!NT_SUCCESS(Status))
- {
- SetLastError(RtlNtStatusToDosError(Status));
- return FALSE;
- }
-
- return TRUE;
-}
-
-
-/*
- * @implemented
- */
-BOOL
-WINAPI
-AccessCheck(IN PSECURITY_DESCRIPTOR pSecurityDescriptor,
- IN HANDLE ClientToken,
- IN DWORD DesiredAccess,
- IN PGENERIC_MAPPING GenericMapping,
- OUT PPRIVILEGE_SET PrivilegeSet OPTIONAL,
- IN OUT LPDWORD PrivilegeSetLength,
- OUT LPDWORD GrantedAccess,
- OUT LPBOOL AccessStatus)
-{
- NTSTATUS Status;
- NTSTATUS NtAccessStatus;
-
- /* Do the access check */
- Status = NtAccessCheck(pSecurityDescriptor,
- ClientToken,
- DesiredAccess,
- GenericMapping,
- PrivilegeSet,
- (PULONG)PrivilegeSetLength,
- (PACCESS_MASK)GrantedAccess,
- &NtAccessStatus);
-
- /* See if the access check operation succeeded */
- if (!NT_SUCCESS(Status))
- {
- /* Check failed */
- SetLastError(RtlNtStatusToDosError(Status));
- return FALSE;
- }
-
- /* Now check the access status */
- if (!NT_SUCCESS(NtAccessStatus))
- {
- /* Access denied */
- SetLastError(RtlNtStatusToDosError(NtAccessStatus));
- *AccessStatus = FALSE;
- }
- else
- {
- /* Access granted */
- *AccessStatus = TRUE;
- }
-
- /* Check succeeded */
- return TRUE;
-}
-
-/*
- * @unimplemented
- */
-BOOL WINAPI AccessCheckByType(
- PSECURITY_DESCRIPTOR pSecurityDescriptor,
- PSID PrincipalSelfSid,
- HANDLE ClientToken,
- DWORD DesiredAccess,
- POBJECT_TYPE_LIST ObjectTypeList,
- DWORD ObjectTypeListLength,
- PGENERIC_MAPPING GenericMapping,
- PPRIVILEGE_SET PrivilegeSet,
- LPDWORD PrivilegeSetLength,
- LPDWORD GrantedAccess,
- LPBOOL AccessStatus)
-{
- FIXME("stub\n");
-
- *AccessStatus = TRUE;
-
- return !*AccessStatus;
-}
-
-/*
- * @implemented
- */
-BOOL WINAPI
-OpenProcessToken(HANDLE ProcessHandle,
- DWORD DesiredAccess,
- PHANDLE TokenHandle)
-{
- NTSTATUS Status;
-
- TRACE("%p, %x, %p.\n", ProcessHandle, DesiredAccess, TokenHandle);
-
- Status = NtOpenProcessToken(ProcessHandle,
- DesiredAccess,
- TokenHandle);
- if (!NT_SUCCESS(Status))
- {
- ERR("NtOpenProcessToken failed! Status %08x.\n", Status);
- SetLastError(RtlNtStatusToDosError(Status));
- return FALSE;
- }
-
- TRACE("Returning token %p.\n", *TokenHandle);
-
- return TRUE;
-}
-
-
-/*
- * @implemented
- */
-BOOL WINAPI
-OpenThreadToken(HANDLE ThreadHandle,
- DWORD DesiredAccess,
- BOOL OpenAsSelf,
- PHANDLE TokenHandle)
-{
- NTSTATUS Status;
-
- Status = NtOpenThreadToken(ThreadHandle,
- DesiredAccess,
- OpenAsSelf,
- TokenHandle);
- if (!NT_SUCCESS(Status))
- {
- SetLastError(RtlNtStatusToDosError(Status));
- return FALSE;
- }
-
- return TRUE;
-}
-
-
-/*
- * @implemented
- */
-BOOL WINAPI
-SetThreadToken(IN PHANDLE ThreadHandle OPTIONAL,
- IN HANDLE TokenHandle)
-{
- NTSTATUS Status;
- HANDLE hThread;
-
- hThread = (ThreadHandle != NULL) ? *ThreadHandle : NtCurrentThread();
-
- Status = NtSetInformationThread(hThread,
- ThreadImpersonationToken,
- &TokenHandle,
- sizeof(HANDLE));
- if (!NT_SUCCESS(Status))
- {
- SetLastError(RtlNtStatusToDosError(Status));
- return FALSE;
- }
-
- return TRUE;
-}
-
-
-/*
- * @implemented
- */
-BOOL WINAPI
-DuplicateTokenEx(IN HANDLE ExistingTokenHandle,
- IN DWORD dwDesiredAccess,
- IN LPSECURITY_ATTRIBUTES lpTokenAttributes OPTIONAL,
- IN SECURITY_IMPERSONATION_LEVEL ImpersonationLevel,
- IN TOKEN_TYPE TokenType,
- OUT PHANDLE DuplicateTokenHandle)
-{
- OBJECT_ATTRIBUTES ObjectAttributes;
- NTSTATUS Status;
- SECURITY_QUALITY_OF_SERVICE Sqos;
-
- TRACE("%p 0x%08x 0x%08x 0x%08x %p\n", ExistingTokenHandle, dwDesiredAccess,
- ImpersonationLevel, TokenType, DuplicateTokenHandle);
-
- Sqos.Length = sizeof(SECURITY_QUALITY_OF_SERVICE);
- Sqos.ImpersonationLevel = ImpersonationLevel;
- Sqos.ContextTrackingMode = 0;
- Sqos.EffectiveOnly = FALSE;
-
- if (lpTokenAttributes != NULL)
- {
- InitializeObjectAttributes(&ObjectAttributes,
- NULL,
- lpTokenAttributes->bInheritHandle ? OBJ_INHERIT : 0,
- NULL,
- lpTokenAttributes->lpSecurityDescriptor);
- }
- else
- {
- InitializeObjectAttributes(&ObjectAttributes,
- NULL,
- 0,
- NULL,
- NULL);
- }
-
- ObjectAttributes.SecurityQualityOfService = &Sqos;
-
- Status = NtDuplicateToken(ExistingTokenHandle,
- dwDesiredAccess,
- &ObjectAttributes,
- FALSE,
- TokenType,
- DuplicateTokenHandle);
- if (!NT_SUCCESS(Status))
- {
- ERR("NtDuplicateToken failed: Status %08x\n", Status);
- SetLastError(RtlNtStatusToDosError(Status));
- return FALSE;
- }
-
- TRACE("Returning token %p.\n", *DuplicateTokenHandle);
-
- return TRUE;
-}
-
-
-/*
- * @implemented
- */
-BOOL WINAPI
-DuplicateToken(IN HANDLE ExistingTokenHandle,
- IN SECURITY_IMPERSONATION_LEVEL ImpersonationLevel,
- OUT PHANDLE DuplicateTokenHandle)
-{
- return DuplicateTokenEx(ExistingTokenHandle,
- TOKEN_IMPERSONATE | TOKEN_QUERY,
- NULL,
- ImpersonationLevel,
- TokenImpersonation,
- DuplicateTokenHandle);
-}
-
-
/*
* @implemented
*/
return Ret;
}
-
-BOOL WINAPI
-CreateRestrictedToken(HANDLE TokenHandle,
- DWORD Flags,
- DWORD DisableSidCount,
- PSID_AND_ATTRIBUTES pSidAndAttributes,
- DWORD DeletePrivilegeCount,
- PLUID_AND_ATTRIBUTES pLUIDAndAttributes,
- DWORD RestrictedSidCount,
- PSID_AND_ATTRIBUTES pSIDAndAttributes,
- PHANDLE NewTokenHandle)
-{
- UNIMPLEMENTED;
- return FALSE;
-}
-
-
/*
* @unimplemented
*/
RtlFreeHeap(RtlGetProcessHeap(), 0, RestrictedSids);
return PSiteSid;
}
-
-
-BOOL
-WINAPI
-CreateProcessWithTokenW(IN HANDLE hToken,
- IN DWORD dwLogonFlags,
- IN LPCWSTR lpApplicationName OPTIONAL,
- IN OUT LPWSTR lpCommandLine OPTIONAL,
- IN DWORD dwCreationFlags,
- IN LPVOID lpEnvironment OPTIONAL,
- IN LPCWSTR lpCurrentDirectory OPTIONAL,
- IN LPSTARTUPINFOW lpStartupInfo,
- OUT LPPROCESS_INFORMATION lpProcessInfo)
-{
- UNIMPLEMENTED;
- return FALSE;
-}
/* used for functions that are a simple wrapper around the corresponding ntdll API */
static __inline BOOL set_ntstatus( NTSTATUS status )
{
- if (status) SetLastError( RtlNtStatusToDosError( status ));
- return !status;
+ if (!NT_SUCCESS(status)) SetLastError( RtlNtStatusToDosError( status ));
+ return NT_SUCCESS(status);
}
static const RECORD SidTable[] =
{ NULL, 0 },
};
+/************************************************************
+ * ADVAPI_IsLocalComputer
+ *
+ * Checks whether the server name indicates local machine.
+ */
+BOOL ADVAPI_IsLocalComputer(LPCWSTR ServerName)
+{
+ DWORD dwSize = MAX_COMPUTERNAME_LENGTH + 1;
+ BOOL Result;
+ LPWSTR buf;
+
+ if (!ServerName || !ServerName[0])
+ return TRUE;
+
+ buf = heap_alloc(dwSize * sizeof(WCHAR));
+ Result = GetComputerNameW(buf, &dwSize);
+ if (Result && (ServerName[0] == '\\') && (ServerName[1] == '\\'))
+ ServerName += 2;
+ Result = Result && !lstrcmpW(ServerName, buf);
+ heap_free(buf);
+
+ return Result;
+}
+
/* Exported functions */
/*
* @implemented
*/
BOOL WINAPI
-AllocateAndInitializeSid(PSID_IDENTIFIER_AUTHORITY pIdentifierAuthority,
- BYTE nSubAuthorityCount,
- DWORD dwSubAuthority0,
- DWORD dwSubAuthority1,
- DWORD dwSubAuthority2,
- DWORD dwSubAuthority3,
- DWORD dwSubAuthority4,
- DWORD dwSubAuthority5,
- DWORD dwSubAuthority6,
- DWORD dwSubAuthority7,
- PSID *pSid)
+OpenProcessToken(HANDLE ProcessHandle,
+ DWORD DesiredAccess,
+ PHANDLE TokenHandle)
+{
+ NTSTATUS Status;
+
+ TRACE("%p, %x, %p.\n", ProcessHandle, DesiredAccess, TokenHandle);
+
+ Status = NtOpenProcessToken(ProcessHandle,
+ DesiredAccess,
+ TokenHandle);
+ if (!NT_SUCCESS(Status))
+ {
+ ERR("NtOpenProcessToken failed! Status %08x.\n", Status);
+ SetLastError(RtlNtStatusToDosError(Status));
+ return FALSE;
+ }
+
+ TRACE("Returning token %p.\n", *TokenHandle);
+
+ return TRUE;
+}
+
+/*
+ * @implemented
+ */
+BOOL WINAPI
+OpenThreadToken(HANDLE ThreadHandle,
+ DWORD DesiredAccess,
+ BOOL OpenAsSelf,
+ PHANDLE TokenHandle)
+{
+ NTSTATUS Status;
+
+ Status = NtOpenThreadToken(ThreadHandle,
+ DesiredAccess,
+ OpenAsSelf,
+ TokenHandle);
+ if (!NT_SUCCESS(Status))
+ {
+ SetLastError(RtlNtStatusToDosError(Status));
+ return FALSE;
+ }
+
+ return TRUE;
+}
+
+/*
+ * @implemented
+ */
+BOOL WINAPI
+AdjustTokenGroups(HANDLE TokenHandle,
+ BOOL ResetToDefault,
+ PTOKEN_GROUPS NewState,
+ DWORD BufferLength,
+ PTOKEN_GROUPS PreviousState,
+ PDWORD ReturnLength)
+{
+ NTSTATUS Status;
+
+ Status = NtAdjustGroupsToken(TokenHandle,
+ ResetToDefault,
+ NewState,
+ BufferLength,
+ PreviousState,
+ (PULONG)ReturnLength);
+ if (!NT_SUCCESS(Status))
+ {
+ SetLastError(RtlNtStatusToDosError(Status));
+ return FALSE;
+ }
+
+ return TRUE;
+}
+
+/*
+ * @implemented
+ */
+BOOL WINAPI
+AdjustTokenPrivileges(HANDLE TokenHandle,
+ BOOL DisableAllPrivileges,
+ PTOKEN_PRIVILEGES NewState,
+ DWORD BufferLength,
+ PTOKEN_PRIVILEGES PreviousState,
+ PDWORD ReturnLength)
+{
+ NTSTATUS Status;
+
+ Status = NtAdjustPrivilegesToken(TokenHandle,
+ DisableAllPrivileges,
+ NewState,
+ BufferLength,
+ PreviousState,
+ (PULONG)ReturnLength);
+ if (STATUS_NOT_ALL_ASSIGNED == Status)
+ {
+ SetLastError(ERROR_NOT_ALL_ASSIGNED);
+ return TRUE;
+ }
+
+ if (!NT_SUCCESS(Status))
+ {
+ SetLastError(RtlNtStatusToDosError(Status));
+ return FALSE;
+ }
+
+ /* AdjustTokenPrivileges is documented to do this */
+ SetLastError(ERROR_SUCCESS);
+
+ return TRUE;
+}
+
+/*
+ * @implemented
+ */
+BOOL WINAPI
+GetTokenInformation(HANDLE TokenHandle,
+ TOKEN_INFORMATION_CLASS TokenInformationClass,
+ LPVOID TokenInformation,
+ DWORD TokenInformationLength,
+ PDWORD ReturnLength)
+{
+ NTSTATUS Status;
+
+ Status = NtQueryInformationToken(TokenHandle,
+ TokenInformationClass,
+ TokenInformation,
+ TokenInformationLength,
+ (PULONG)ReturnLength);
+ if (!NT_SUCCESS(Status))
+ {
+ SetLastError(RtlNtStatusToDosError(Status));
+ return FALSE;
+ }
+
+ return TRUE;
+}
+
+/*
+ * @implemented
+ */
+BOOL WINAPI
+SetTokenInformation(HANDLE TokenHandle,
+ TOKEN_INFORMATION_CLASS TokenInformationClass,
+ LPVOID TokenInformation,
+ DWORD TokenInformationLength)
+{
+ NTSTATUS Status;
+
+ Status = NtSetInformationToken(TokenHandle,
+ TokenInformationClass,
+ TokenInformation,
+ TokenInformationLength);
+ if (!NT_SUCCESS(Status))
+ {
+ SetLastError(RtlNtStatusToDosError(Status));
+ return FALSE;
+ }
+
+ return TRUE;
+}
+
+/*
+ * @implemented
+ */
+BOOL WINAPI
+SetThreadToken(IN PHANDLE ThreadHandle OPTIONAL,
+ IN HANDLE TokenHandle)
{
NTSTATUS Status;
+ HANDLE hThread;
+
+ hThread = (ThreadHandle != NULL) ? *ThreadHandle : NtCurrentThread();
- Status = RtlAllocateAndInitializeSid(pIdentifierAuthority,
- nSubAuthorityCount,
- dwSubAuthority0,
- dwSubAuthority1,
- dwSubAuthority2,
- dwSubAuthority3,
- dwSubAuthority4,
- dwSubAuthority5,
- dwSubAuthority6,
- dwSubAuthority7,
- pSid);
+ Status = NtSetInformationThread(hThread,
+ ThreadImpersonationToken,
+ &TokenHandle,
+ sizeof(HANDLE));
if (!NT_SUCCESS(Status))
{
SetLastError(RtlNtStatusToDosError(Status));
return TRUE;
}
+/*************************************************************************
+ * CreateRestrictedToken [ADVAPI32.@]
+ *
+ * Create a new more restricted token from an existing token.
+ *
+ * PARAMS
+ * baseToken [I] Token to base the new restricted token on
+ * flags [I] Options
+ * nDisableSids [I] Length of disableSids array
+ * disableSids [I] Array of SIDs to disable in the new token
+ * nDeletePrivs [I] Length of deletePrivs array
+ * deletePrivs [I] Array of privileges to delete in the new token
+ * nRestrictSids [I] Length of restrictSids array
+ * restrictSids [I] Array of SIDs to restrict in the new token
+ * newToken [O] Address where the new token is stored
+ *
+ * RETURNS
+ * Success: TRUE
+ * Failure: FALSE
+ */
+BOOL WINAPI CreateRestrictedToken(
+ HANDLE baseToken,
+ DWORD flags,
+ DWORD nDisableSids,
+ PSID_AND_ATTRIBUTES disableSids,
+ DWORD nDeletePrivs,
+ PLUID_AND_ATTRIBUTES deletePrivs,
+ DWORD nRestrictSids,
+ PSID_AND_ATTRIBUTES restrictSids,
+ PHANDLE newToken)
+{
+ TOKEN_TYPE type;
+ SECURITY_IMPERSONATION_LEVEL level = TokenImpersonationLevel;
+ DWORD size;
+
+ FIXME("(%p, 0x%x, %u, %p, %u, %p, %u, %p, %p): stub\n",
+ baseToken, flags, nDisableSids, disableSids,
+ nDeletePrivs, deletePrivs,
+ nRestrictSids, restrictSids,
+ newToken);
+
+ size = sizeof(type);
+ if (!GetTokenInformation( baseToken, TokenType, &type, size, &size )) return FALSE;
+ if (type == TokenImpersonation)
+ {
+ size = sizeof(level);
+ if (!GetTokenInformation( baseToken, TokenImpersonationLevel, &level, size, &size ))
+ return FALSE;
+ }
+ return DuplicateTokenEx( baseToken, MAXIMUM_ALLOWED, NULL, level, type, newToken );
+}
+
+/******************************************************************************
+ * AllocateAndInitializeSid [ADVAPI32.@]
+ *
+ * PARAMS
+ * pIdentifierAuthority []
+ * nSubAuthorityCount []
+ * nSubAuthority0 []
+ * nSubAuthority1 []
+ * nSubAuthority2 []
+ * nSubAuthority3 []
+ * nSubAuthority4 []
+ * nSubAuthority5 []
+ * nSubAuthority6 []
+ * nSubAuthority7 []
+ * pSid []
+ */
+BOOL WINAPI
+AllocateAndInitializeSid( PSID_IDENTIFIER_AUTHORITY pIdentifierAuthority,
+ BYTE nSubAuthorityCount,
+ DWORD nSubAuthority0, DWORD nSubAuthority1,
+ DWORD nSubAuthority2, DWORD nSubAuthority3,
+ DWORD nSubAuthority4, DWORD nSubAuthority5,
+ DWORD nSubAuthority6, DWORD nSubAuthority7,
+ PSID *pSid )
+{
+ return set_ntstatus( RtlAllocateAndInitializeSid(
+ pIdentifierAuthority, nSubAuthorityCount,
+ nSubAuthority0, nSubAuthority1, nSubAuthority2, nSubAuthority3,
+ nSubAuthority4, nSubAuthority5, nSubAuthority6, nSubAuthority7,
+ pSid ));
+}
+
/*
* @implemented
*
pSourceSid);
if (!NT_SUCCESS (Status))
{
- SetLastError(RtlNtStatusToDosError(Status));
- return FALSE;
+ SetLastError(RtlNtStatusToDosError(Status));
+ return FALSE;
+ }
+
+ return TRUE;
+}
+
+/*
+ * @unimplemented
+ */
+BOOL
+WINAPI
+CreateWellKnownSid(IN WELL_KNOWN_SID_TYPE WellKnownSidType,
+ IN PSID DomainSid OPTIONAL,
+ OUT PSID pSid,
+ IN OUT DWORD* cbSid)
+{
+ unsigned int i;
+ TRACE("(%d, %s, %p, %p)\n", WellKnownSidType, debugstr_sid(DomainSid), pSid, cbSid);
+
+ if (cbSid == NULL || (DomainSid && !IsValidSid(DomainSid)))
+ {
+ SetLastError(ERROR_INVALID_PARAMETER);
+ return FALSE;
+ }
+
+ for (i = 0; i < sizeof(WellKnownSids)/sizeof(WellKnownSids[0]); i++) {
+ if (WellKnownSids[i].Type == WellKnownSidType) {
+ DWORD length = GetSidLengthRequired(WellKnownSids[i].Sid.SubAuthorityCount);
+
+ if (*cbSid < length)
+ {
+ *cbSid = length;
+ SetLastError(ERROR_INSUFFICIENT_BUFFER);
+ return FALSE;
+ }
+ if (!pSid)
+ {
+ SetLastError(ERROR_INVALID_PARAMETER);
+ return FALSE;
+ }
+ CopyMemory(pSid, &WellKnownSids[i].Sid.Revision, length);
+ *cbSid = length;
+ return TRUE;
+ }
+ }
+
+ if (DomainSid == NULL || *GetSidSubAuthorityCount(DomainSid) == SID_MAX_SUB_AUTHORITIES)
+ {
+ SetLastError(ERROR_INVALID_PARAMETER);
+ return FALSE;
+ }
+
+ for (i = 0; i < sizeof(WellKnownRids)/sizeof(WellKnownRids[0]); i++)
+ if (WellKnownRids[i].Type == WellKnownSidType) {
+ UCHAR domain_subauth = *GetSidSubAuthorityCount(DomainSid);
+ DWORD domain_sid_length = GetSidLengthRequired(domain_subauth);
+ DWORD output_sid_length = GetSidLengthRequired(domain_subauth + 1);
+
+ if (*cbSid < output_sid_length)
+ {
+ *cbSid = output_sid_length;
+ SetLastError(ERROR_INSUFFICIENT_BUFFER);
+ return FALSE;
+ }
+ if (!pSid)
+ {
+ SetLastError(ERROR_INVALID_PARAMETER);
+ return FALSE;
+ }
+ CopyMemory(pSid, DomainSid, domain_sid_length);
+ (*GetSidSubAuthorityCount(pSid))++;
+ (*GetSidSubAuthority(pSid, domain_subauth)) = WellKnownRids[i].Rid;
+ *cbSid = output_sid_length;
+ return TRUE;
+ }
+
+ SetLastError(ERROR_INVALID_PARAMETER);
+ return FALSE;
+}
+
+/*
+ * @unimplemented
+ */
+BOOL
+WINAPI
+IsWellKnownSid(IN PSID pSid,
+ IN WELL_KNOWN_SID_TYPE WellKnownSidType)
+{
+ unsigned int i;
+ TRACE("(%s, %d)\n", debugstr_sid(pSid), WellKnownSidType);
+
+ for (i = 0; i < sizeof(WellKnownSids) / sizeof(WellKnownSids[0]); i++)
+ {
+ if (WellKnownSids[i].Type == WellKnownSidType)
+ {
+ if (EqualSid(pSid, (PSID)(&WellKnownSids[i].Sid.Revision)))
+ return TRUE;
+ }
+ }
+
+ return FALSE;
+}
+
+/*
+ * @implemented
+ */
+BOOL
+WINAPI
+IsValidSid(PSID pSid)
+{
+ return (BOOL)RtlValidSid(pSid);
+}
+
+/*
+ * @implemented
+ */
+BOOL
+WINAPI
+EqualSid(PSID pSid1,
+ PSID pSid2)
+{
+ SetLastError(ERROR_SUCCESS);
+ return RtlEqualSid (pSid1, pSid2);
+}
+
+/*
+ * @implemented
+ */
+BOOL
+WINAPI
+EqualPrefixSid(PSID pSid1,
+ PSID pSid2)
+{
+ return RtlEqualPrefixSid (pSid1, pSid2);
+}
+
+/*
+ * @implemented
+ */
+DWORD
+WINAPI
+GetSidLengthRequired(UCHAR nSubAuthorityCount)
+{
+ return (DWORD)RtlLengthRequiredSid(nSubAuthorityCount);
+}
+
+/*
+ * @implemented
+ */
+BOOL
+WINAPI
+InitializeSid(PSID Sid,
+ PSID_IDENTIFIER_AUTHORITY pIdentifierAuthority,
+ BYTE nSubAuthorityCount)
+{
+ NTSTATUS Status;
+
+ Status = RtlInitializeSid(Sid,
+ pIdentifierAuthority,
+ nSubAuthorityCount);
+ if (!NT_SUCCESS(Status))
+ {
+ SetLastError(RtlNtStatusToDosError(Status));
+ return FALSE;
+ }
+
+ return TRUE;
+}
+
+/*
+ * @implemented
+ */
+PSID_IDENTIFIER_AUTHORITY
+WINAPI
+GetSidIdentifierAuthority(PSID pSid)
+{
+ return RtlIdentifierAuthoritySid(pSid);
+}
+
+/*
+ * @implemented
+ */
+PDWORD
+WINAPI
+GetSidSubAuthority(PSID pSid,
+ DWORD nSubAuthority)
+{
+ SetLastError(ERROR_SUCCESS);
+ return (PDWORD)RtlSubAuthoritySid(pSid, nSubAuthority);
+}
+
+/*
+ * @implemented
+ */
+PUCHAR
+WINAPI
+GetSidSubAuthorityCount(PSID pSid)
+{
+ SetLastError(ERROR_SUCCESS);
+ return RtlSubAuthorityCountSid(pSid);
+}
+
+/*
+ * @implemented
+ */
+DWORD
+WINAPI
+GetLengthSid(PSID pSid)
+{
+ return (DWORD)RtlLengthSid(pSid);
+}
+
+/*
+ * @implemented
+ */
+BOOL
+WINAPI
+InitializeSecurityDescriptor(PSECURITY_DESCRIPTOR pSecurityDescriptor,
+ DWORD dwRevision)
+{
+ NTSTATUS Status;
+
+ Status = RtlCreateSecurityDescriptor(pSecurityDescriptor,
+ dwRevision);
+ if (!NT_SUCCESS(Status))
+ {
+ SetLastError(RtlNtStatusToDosError(Status));
+ return FALSE;
+ }
+
+ return TRUE;
+}
+
+/*
+ * @implemented
+ */
+BOOL
+WINAPI
+MakeAbsoluteSD(PSECURITY_DESCRIPTOR pSelfRelativeSecurityDescriptor,
+ PSECURITY_DESCRIPTOR pAbsoluteSecurityDescriptor,
+ LPDWORD lpdwAbsoluteSecurityDescriptorSize,
+ PACL pDacl,
+ LPDWORD lpdwDaclSize,
+ PACL pSacl,
+ LPDWORD lpdwSaclSize,
+ PSID pOwner,
+ LPDWORD lpdwOwnerSize,
+ PSID pPrimaryGroup,
+ LPDWORD lpdwPrimaryGroupSize)
+{
+ NTSTATUS Status;
+
+ Status = RtlSelfRelativeToAbsoluteSD(pSelfRelativeSecurityDescriptor,
+ pAbsoluteSecurityDescriptor,
+ lpdwAbsoluteSecurityDescriptorSize,
+ pDacl,
+ lpdwDaclSize,
+ pSacl,
+ lpdwSaclSize,
+ pOwner,
+ lpdwOwnerSize,
+ pPrimaryGroup,
+ lpdwPrimaryGroupSize);
+ if (!NT_SUCCESS(Status))
+ {
+ SetLastError(RtlNtStatusToDosError(Status));
+ return FALSE;
+ }
+
+ return TRUE;
+}
+
+/******************************************************************************
+ * GetKernelObjectSecurity [ADVAPI32.@]
+ */
+BOOL WINAPI GetKernelObjectSecurity(
+ HANDLE Handle,
+ SECURITY_INFORMATION RequestedInformation,
+ PSECURITY_DESCRIPTOR pSecurityDescriptor,
+ DWORD nLength,
+ LPDWORD lpnLengthNeeded )
+{
+ TRACE("(%p,0x%08x,%p,0x%08x,%p)\n", Handle, RequestedInformation,
+ pSecurityDescriptor, nLength, lpnLengthNeeded);
+
+ return set_ntstatus( NtQuerySecurityObject(Handle, RequestedInformation, pSecurityDescriptor,
+ nLength, lpnLengthNeeded ));
+}
+
+/*
+ * @implemented
+ */
+BOOL
+WINAPI
+InitializeAcl(PACL pAcl,
+ DWORD nAclLength,
+ DWORD dwAclRevision)
+{
+ NTSTATUS Status;
+
+ Status = RtlCreateAcl(pAcl,
+ nAclLength,
+ dwAclRevision);
+ if (!NT_SUCCESS(Status))
+ {
+ SetLastError(RtlNtStatusToDosError(Status));
+ return FALSE;
+ }
+
+ return TRUE;
+}
+
+BOOL WINAPI ImpersonateNamedPipeClient( HANDLE hNamedPipe )
+{
+ IO_STATUS_BLOCK io_block;
+
+ TRACE("(%p)\n", hNamedPipe);
+
+ return set_ntstatus( NtFsControlFile(hNamedPipe, NULL, NULL, NULL,
+ &io_block, FSCTL_PIPE_IMPERSONATE, NULL, 0, NULL, 0) );
+}
+
+/*
+ * @implemented
+ */
+BOOL
+WINAPI
+AddAccessAllowedAce(PACL pAcl,
+ DWORD dwAceRevision,
+ DWORD AccessMask,
+ PSID pSid)
+{
+ NTSTATUS Status;
+
+ Status = RtlAddAccessAllowedAce(pAcl,
+ dwAceRevision,
+ AccessMask,
+ pSid);
+ if (!NT_SUCCESS(Status))
+ {
+ SetLastError(RtlNtStatusToDosError(Status));
+ return FALSE;
+ }
+
+ return TRUE;
+}
+
+/*
+ * @implemented
+ */
+BOOL WINAPI
+AddAccessAllowedAceEx(PACL pAcl,
+ DWORD dwAceRevision,
+ DWORD AceFlags,
+ DWORD AccessMask,
+ PSID pSid)
+{
+ NTSTATUS Status;
+
+ Status = RtlAddAccessAllowedAceEx(pAcl,
+ dwAceRevision,
+ AceFlags,
+ AccessMask,
+ pSid);
+ if (!NT_SUCCESS(Status))
+ {
+ SetLastError(RtlNtStatusToDosError(Status));
+ return FALSE;
+ }
+
+ return TRUE;
+}
+
+/*
+ * @implemented
+ */
+BOOL
+WINAPI
+AddAccessDeniedAce(PACL pAcl,
+ DWORD dwAceRevision,
+ DWORD AccessMask,
+ PSID pSid)
+{
+ NTSTATUS Status;
+
+ Status = RtlAddAccessDeniedAce(pAcl,
+ dwAceRevision,
+ AccessMask,
+ pSid);
+ if (!NT_SUCCESS(Status))
+ {
+ SetLastError(RtlNtStatusToDosError(Status));
+ return FALSE;
+ }
+
+ return TRUE;
+}
+
+/*
+ * @implemented
+ */
+BOOL WINAPI
+AddAccessDeniedAceEx(PACL pAcl,
+ DWORD dwAceRevision,
+ DWORD AceFlags,
+ DWORD AccessMask,
+ PSID pSid)
+{
+ NTSTATUS Status;
+
+ Status = RtlAddAccessDeniedAceEx(pAcl,
+ dwAceRevision,
+ AceFlags,
+ AccessMask,
+ pSid);
+ if (!NT_SUCCESS(Status))
+ {
+ SetLastError(RtlNtStatusToDosError(Status));
+ return FALSE;
+ }
+
+ return TRUE;
+}
+
+/*
+ * @implemented
+ */
+BOOL
+WINAPI
+AddAce(PACL pAcl,
+ DWORD dwAceRevision,
+ DWORD dwStartingAceIndex,
+ LPVOID pAceList,
+ DWORD nAceListLength)
+{
+ NTSTATUS Status;
+
+ Status = RtlAddAce(pAcl,
+ dwAceRevision,
+ dwStartingAceIndex,
+ pAceList,
+ nAceListLength);
+ if (!NT_SUCCESS(Status))
+ {
+ SetLastError(RtlNtStatusToDosError(Status));
+ return FALSE;
+ }
+
+ return TRUE;
+}
+
+/*
+ * @implemented
+ */
+BOOL
+WINAPI
+DeleteAce(PACL pAcl,
+ DWORD dwAceIndex)
+{
+ NTSTATUS Status;
+
+ Status = RtlDeleteAce(pAcl,
+ dwAceIndex);
+ if (!NT_SUCCESS(Status))
+ {
+ SetLastError(RtlNtStatusToDosError(Status));
+ return FALSE;
+ }
+
+ return TRUE;
+}
+
+/*
+ * @implemented
+ */
+BOOL
+WINAPI
+FindFirstFreeAce(PACL pAcl,
+ LPVOID *pAce)
+{
+ return RtlFirstFreeAce(pAcl,
+ (PACE*)pAce);
+}
+
+
+/*
+ * @implemented
+ */
+BOOL
+WINAPI
+GetAce(PACL pAcl,
+ DWORD dwAceIndex,
+ LPVOID *pAce)
+{
+ NTSTATUS Status;
+
+ Status = RtlGetAce(pAcl,
+ dwAceIndex,
+ pAce);
+ if (!NT_SUCCESS(Status))
+ {
+ SetLastError(RtlNtStatusToDosError(Status));
+ return FALSE;
+ }
+
+ return TRUE;
+}
+
+/*
+ * @implemented
+ */
+BOOL
+WINAPI
+GetAclInformation(PACL pAcl,
+ LPVOID pAclInformation,
+ DWORD nAclInformationLength,
+ ACL_INFORMATION_CLASS dwAclInformationClass)
+{
+ NTSTATUS Status;
+
+ Status = RtlQueryInformationAcl(pAcl,
+ pAclInformation,
+ nAclInformationLength,
+ dwAclInformationClass);
+ if (!NT_SUCCESS(Status))
+ {
+ SetLastError(RtlNtStatusToDosError(Status));
+ return FALSE;
+ }
+
+ return TRUE;
+}
+
+/*
+ * @implemented
+ */
+BOOL
+WINAPI
+IsValidAcl(PACL pAcl)
+{
+ return RtlValidAcl (pAcl);
+}
+
+/*
+ * @implemented
+ */
+BOOL WINAPI
+AllocateLocallyUniqueId(PLUID Luid)
+{
+ NTSTATUS Status;
+
+ Status = NtAllocateLocallyUniqueId (Luid);
+ if (!NT_SUCCESS (Status))
+ {
+ SetLastError(RtlNtStatusToDosError(Status));
+ return FALSE;
+ }
+
+ return TRUE;
+}
+
+/**********************************************************************
+ * LookupPrivilegeDisplayNameA EXPORTED
+ *
+ * @unimplemented
+ */
+BOOL
+WINAPI
+LookupPrivilegeDisplayNameA(LPCSTR lpSystemName,
+ LPCSTR lpName,
+ LPSTR lpDisplayName,
+ LPDWORD cbDisplayName,
+ LPDWORD lpLanguageId)
+{
+ FIXME("%s() not implemented!\n", __FUNCTION__);
+ SetLastError (ERROR_CALL_NOT_IMPLEMENTED);
+ return FALSE;
+}
+
+
+/**********************************************************************
+ * LookupPrivilegeDisplayNameW EXPORTED
+ *
+ * @unimplemented
+ */
+BOOL
+WINAPI
+LookupPrivilegeDisplayNameW(LPCWSTR lpSystemName,
+ LPCWSTR lpName,
+ LPWSTR lpDisplayName,
+ LPDWORD cbDisplayName,
+ LPDWORD lpLanguageId)
+{
+ FIXME("%s() not implemented!\n", __FUNCTION__);
+ SetLastError (ERROR_CALL_NOT_IMPLEMENTED);
+ return FALSE;
+}
+
+/**********************************************************************
+ * LookupPrivilegeNameA EXPORTED
+ *
+ * @implemented
+ */
+BOOL
+WINAPI
+LookupPrivilegeNameA(LPCSTR lpSystemName,
+ PLUID lpLuid,
+ LPSTR lpName,
+ LPDWORD cchName)
+{
+ UNICODE_STRING lpSystemNameW;
+ BOOL ret;
+ DWORD wLen = 0;
+
+ TRACE("%s %p %p %p\n", debugstr_a(lpSystemName), lpLuid, lpName, cchName);
+
+ RtlCreateUnicodeStringFromAsciiz(&lpSystemNameW, lpSystemName);
+ ret = LookupPrivilegeNameW(lpSystemNameW.Buffer, lpLuid, NULL, &wLen);
+ if (!ret && GetLastError() == ERROR_INSUFFICIENT_BUFFER)
+ {
+ LPWSTR lpNameW = HeapAlloc(GetProcessHeap(), 0, wLen * sizeof(WCHAR));
+
+ ret = LookupPrivilegeNameW(lpSystemNameW.Buffer, lpLuid, lpNameW,
+ &wLen);
+ if (ret)
+ {
+ /* Windows crashes if cchName is NULL, so will I */
+ unsigned int len = WideCharToMultiByte(CP_ACP, 0, lpNameW, -1, lpName,
+ *cchName, NULL, NULL);
+
+ if (len == 0)
+ {
+ /* WideCharToMultiByte failed */
+ ret = FALSE;
+ }
+ else if (len > *cchName)
+ {
+ *cchName = len;
+ SetLastError(ERROR_INSUFFICIENT_BUFFER);
+ ret = FALSE;
+ }
+ else
+ {
+ /* WideCharToMultiByte succeeded, output length needs to be
+ * length not including NULL terminator
+ */
+ *cchName = len - 1;
+ }
+ }
+ HeapFree(GetProcessHeap(), 0, lpNameW);
+ }
+ RtlFreeUnicodeString(&lpSystemNameW);
+ return ret;
+}
+
+/******************************************************************************
+ * GetFileSecurityA [ADVAPI32.@]
+ *
+ * Obtains Specified information about the security of a file or directory.
+ *
+ * PARAMS
+ * lpFileName [I] Name of the file to get info for
+ * RequestedInformation [I] SE_ flags from "winnt.h"
+ * pSecurityDescriptor [O] Destination for security information
+ * nLength [I] Length of pSecurityDescriptor
+ * lpnLengthNeeded [O] Destination for length of returned security information
+ *
+ * RETURNS
+ * Success: TRUE. pSecurityDescriptor contains the requested information.
+ * Failure: FALSE. lpnLengthNeeded contains the required space to return the info.
+ *
+ * NOTES
+ * The information returned is constrained by the callers access rights and
+ * privileges.
+ *
+ * @implemented
+ */
+BOOL
+WINAPI
+GetFileSecurityA(LPCSTR lpFileName,
+ SECURITY_INFORMATION RequestedInformation,
+ PSECURITY_DESCRIPTOR pSecurityDescriptor,
+ DWORD nLength,
+ LPDWORD lpnLengthNeeded)
+{
+ UNICODE_STRING FileName;
+ BOOL bResult;
+
+ if (!RtlCreateUnicodeStringFromAsciiz(&FileName, lpFileName))
+ {
+ SetLastError(ERROR_NOT_ENOUGH_MEMORY);
+ return FALSE;
+ }
+
+ bResult = GetFileSecurityW(FileName.Buffer,
+ RequestedInformation,
+ pSecurityDescriptor,
+ nLength,
+ lpnLengthNeeded);
+
+ RtlFreeUnicodeString(&FileName);
+
+ return bResult;
+}
+
+/*
+ * @implemented
+ */
+BOOL
+WINAPI
+GetFileSecurityW(LPCWSTR lpFileName,
+ SECURITY_INFORMATION RequestedInformation,
+ PSECURITY_DESCRIPTOR pSecurityDescriptor,
+ DWORD nLength,
+ LPDWORD lpnLengthNeeded)
+{
+ OBJECT_ATTRIBUTES ObjectAttributes;
+ IO_STATUS_BLOCK StatusBlock;
+ UNICODE_STRING FileName;
+ ULONG AccessMask = 0;
+ HANDLE FileHandle;
+ NTSTATUS Status;
+
+ TRACE("GetFileSecurityW() called\n");
+
+ QuerySecurityAccessMask(RequestedInformation, &AccessMask);
+
+ if (!RtlDosPathNameToNtPathName_U(lpFileName,
+ &FileName,
+ NULL,
+ NULL))
+ {
+ ERR("Invalid path\n");
+ SetLastError(ERROR_INVALID_NAME);
+ return FALSE;
+ }
+
+ InitializeObjectAttributes(&ObjectAttributes,
+ &FileName,
+ OBJ_CASE_INSENSITIVE,
+ NULL,
+ NULL);
+
+ Status = NtOpenFile(&FileHandle,
+ AccessMask,
+ &ObjectAttributes,
+ &StatusBlock,
+ FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE,
+ 0);
+
+ RtlFreeHeap(RtlGetProcessHeap(),
+ 0,
+ FileName.Buffer);
+
+ if (!NT_SUCCESS(Status))
+ {
+ ERR("NtOpenFile() failed (Status %lx)\n", Status);
+ SetLastError(RtlNtStatusToDosError(Status));
+ return FALSE;
+ }
+
+ Status = NtQuerySecurityObject(FileHandle,
+ RequestedInformation,
+ pSecurityDescriptor,
+ nLength,
+ lpnLengthNeeded);
+ NtClose(FileHandle);
+ if (!NT_SUCCESS(Status))
+ {
+ ERR("NtQuerySecurityObject() failed (Status %lx)\n", Status);
+ SetLastError(RtlNtStatusToDosError(Status));
+ return FALSE;
+ }
+
+ return TRUE;
+}
+
+/******************************************************************************
+ * SetFileSecurityA [ADVAPI32.@]
+ * Sets the security of a file or directory
+ *
+ * @implemented
+ */
+BOOL
+WINAPI
+SetFileSecurityA(LPCSTR lpFileName,
+ SECURITY_INFORMATION SecurityInformation,
+ PSECURITY_DESCRIPTOR pSecurityDescriptor)
+{
+ UNICODE_STRING FileName;
+ BOOL bResult;
+
+ if (!RtlCreateUnicodeStringFromAsciiz(&FileName, lpFileName))
+ {
+ SetLastError(ERROR_NOT_ENOUGH_MEMORY);
+ return FALSE;
+ }
+
+ bResult = SetFileSecurityW(FileName.Buffer,
+ SecurityInformation,
+ pSecurityDescriptor);
+
+ RtlFreeUnicodeString(&FileName);
+
+ return bResult;
+}
+
+/******************************************************************************
+ * SetFileSecurityW [ADVAPI32.@]
+ * Sets the security of a file or directory
+ *
+ * @implemented
+ */
+BOOL
+WINAPI
+SetFileSecurityW(LPCWSTR lpFileName,
+ SECURITY_INFORMATION SecurityInformation,
+ PSECURITY_DESCRIPTOR pSecurityDescriptor)
+{
+ OBJECT_ATTRIBUTES ObjectAttributes;
+ IO_STATUS_BLOCK StatusBlock;
+ UNICODE_STRING FileName;
+ ULONG AccessMask = 0;
+ HANDLE FileHandle;
+ NTSTATUS Status;
+
+ TRACE("SetFileSecurityW() called\n");
+
+ SetSecurityAccessMask(SecurityInformation, &AccessMask);
+
+ if (!RtlDosPathNameToNtPathName_U(lpFileName,
+ &FileName,
+ NULL,
+ NULL))
+ {
+ ERR("Invalid path\n");
+ SetLastError(ERROR_INVALID_NAME);
+ return FALSE;
+ }
+
+ InitializeObjectAttributes(&ObjectAttributes,
+ &FileName,
+ OBJ_CASE_INSENSITIVE,
+ NULL,
+ NULL);
+
+ Status = NtOpenFile(&FileHandle,
+ AccessMask,
+ &ObjectAttributes,
+ &StatusBlock,
+ FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE,
+ 0);
+
+ RtlFreeHeap(RtlGetProcessHeap(),
+ 0,
+ FileName.Buffer);
+
+ if (!NT_SUCCESS(Status))
+ {
+ ERR("NtOpenFile() failed (Status %lx)\n", Status);
+ SetLastError(RtlNtStatusToDosError(Status));
+ return FALSE;
+ }
+
+ Status = NtSetSecurityObject(FileHandle,
+ SecurityInformation,
+ pSecurityDescriptor);
+ NtClose(FileHandle);
+
+ if (!NT_SUCCESS(Status))
+ {
+ ERR("NtSetSecurityObject() failed (Status %lx)\n", Status);
+ SetLastError(RtlNtStatusToDosError(Status));
+ return FALSE;
+ }
+
+ return TRUE;
+}
+
+/******************************************************************************
+ * QueryWindows31FilesMigration [ADVAPI32.@]
+ *
+ * PARAMS
+ * x1 []
+ */
+BOOL WINAPI
+QueryWindows31FilesMigration( DWORD x1 )
+{
+ FIXME("(%d):stub\n",x1);
+ return TRUE;
+}
+
+/******************************************************************************
+ * SynchronizeWindows31FilesAndWindowsNTRegistry [ADVAPI32.@]
+ *
+ * PARAMS
+ * x1 []
+ * x2 []
+ * x3 []
+ * x4 []
+ */
+BOOL WINAPI
+SynchronizeWindows31FilesAndWindowsNTRegistry( DWORD x1, DWORD x2, DWORD x3,
+ DWORD x4 )
+{
+ FIXME("(0x%08x,0x%08x,0x%08x,0x%08x):stub\n",x1,x2,x3,x4);
+ return TRUE;
+}
+
+/*
+ * @implemented
+ */
+BOOL
+WINAPI
+RevertToSelf(VOID)
+{
+ NTSTATUS Status;
+ HANDLE Token = NULL;
+
+ Status = NtSetInformationThread(NtCurrentThread(),
+ ThreadImpersonationToken,
+ &Token,
+ sizeof(HANDLE));
+ if (!NT_SUCCESS(Status))
+ {
+ SetLastError(RtlNtStatusToDosError(Status));
+ return FALSE;
+ }
+
+ return TRUE;
+}
+
+/*
+ * @implemented
+ */
+BOOL
+WINAPI
+ImpersonateSelf(SECURITY_IMPERSONATION_LEVEL ImpersonationLevel)
+{
+ NTSTATUS Status;
+
+ Status = RtlImpersonateSelf(ImpersonationLevel);
+ if (!NT_SUCCESS(Status))
+ {
+ SetLastError(RtlNtStatusToDosError(Status));
+ return FALSE;
+ }
+
+ return TRUE;
+}
+
+/*
+ * @implemented
+ */
+BOOL
+WINAPI
+AccessCheck(IN PSECURITY_DESCRIPTOR pSecurityDescriptor,
+ IN HANDLE ClientToken,
+ IN DWORD DesiredAccess,
+ IN PGENERIC_MAPPING GenericMapping,
+ OUT PPRIVILEGE_SET PrivilegeSet OPTIONAL,
+ IN OUT LPDWORD PrivilegeSetLength,
+ OUT LPDWORD GrantedAccess,
+ OUT LPBOOL AccessStatus)
+{
+ NTSTATUS Status;
+ NTSTATUS NtAccessStatus;
+
+ /* Do the access check */
+ Status = NtAccessCheck(pSecurityDescriptor,
+ ClientToken,
+ DesiredAccess,
+ GenericMapping,
+ PrivilegeSet,
+ (PULONG)PrivilegeSetLength,
+ (PACCESS_MASK)GrantedAccess,
+ &NtAccessStatus);
+
+ /* See if the access check operation succeeded */
+ if (!NT_SUCCESS(Status))
+ {
+ /* Check failed */
+ SetLastError(RtlNtStatusToDosError(Status));
+ return FALSE;
+ }
+
+ /* Now check the access status */
+ if (!NT_SUCCESS(NtAccessStatus))
+ {
+ /* Access denied */
+ SetLastError(RtlNtStatusToDosError(NtAccessStatus));
+ *AccessStatus = FALSE;
+ }
+ else
+ {
+ /* Access granted */
+ *AccessStatus = TRUE;
+ }
+
+ /* Check succeeded */
+ return TRUE;
+}
+
+/*
+ * @unimplemented
+ */
+BOOL WINAPI AccessCheckByType(
+ PSECURITY_DESCRIPTOR pSecurityDescriptor,
+ PSID PrincipalSelfSid,
+ HANDLE ClientToken,
+ DWORD DesiredAccess,
+ POBJECT_TYPE_LIST ObjectTypeList,
+ DWORD ObjectTypeListLength,
+ PGENERIC_MAPPING GenericMapping,
+ PPRIVILEGE_SET PrivilegeSet,
+ LPDWORD PrivilegeSetLength,
+ LPDWORD GrantedAccess,
+ LPBOOL AccessStatus)
+{
+ FIXME("stub\n");
+
+ *AccessStatus = TRUE;
+
+ return !*AccessStatus;
+}
+
+/*
+ * @implemented
+ */
+BOOL
+WINAPI
+SetKernelObjectSecurity(HANDLE Handle,
+ SECURITY_INFORMATION SecurityInformation,
+ PSECURITY_DESCRIPTOR SecurityDescriptor)
+{
+ NTSTATUS Status;
+
+ Status = NtSetSecurityObject(Handle,
+ SecurityInformation,
+ SecurityDescriptor);
+ if (!NT_SUCCESS(Status))
+ {
+ SetLastError(RtlNtStatusToDosError(Status));
+ return FALSE;
+ }
+
+ return TRUE;
+}
+
+/*
+ * @implemented
+ */
+BOOL
+WINAPI
+AddAuditAccessAce(PACL pAcl,
+ DWORD dwAceRevision,
+ DWORD dwAccessMask,
+ PSID pSid,
+ BOOL bAuditSuccess,
+ BOOL bAuditFailure)
+{
+ NTSTATUS Status;
+
+ Status = RtlAddAuditAccessAce(pAcl,
+ dwAceRevision,
+ dwAccessMask,
+ pSid,
+ bAuditSuccess,
+ bAuditFailure);
+ if (!NT_SUCCESS(Status))
+ {
+ SetLastError(RtlNtStatusToDosError(Status));
+ return FALSE;
+ }
+
+ return TRUE;
+}
+
+/*
+ * @implemented
+ */
+BOOL WINAPI
+AddAuditAccessAceEx(PACL pAcl,
+ DWORD dwAceRevision,
+ DWORD AceFlags,
+ DWORD dwAccessMask,
+ PSID pSid,
+ BOOL bAuditSuccess,
+ BOOL bAuditFailure)
+{
+ NTSTATUS Status;
+
+ Status = RtlAddAuditAccessAceEx(pAcl,
+ dwAceRevision,
+ AceFlags,
+ dwAccessMask,
+ pSid,
+ bAuditSuccess,
+ bAuditFailure);
+ if (!NT_SUCCESS(Status))
+ {
+ SetLastError(RtlNtStatusToDosError(Status));
+ return FALSE;
+ }
+
+ return TRUE;
+}
+
+/******************************************************************************
+ * LookupAccountNameA [ADVAPI32.@]
+ *
+ * @implemented
+ */
+BOOL
+WINAPI
+LookupAccountNameA(LPCSTR SystemName,
+ LPCSTR AccountName,
+ PSID Sid,
+ LPDWORD SidLength,
+ LPSTR ReferencedDomainName,
+ LPDWORD hReferencedDomainNameLength,
+ PSID_NAME_USE SidNameUse)
+{
+ BOOL ret;
+ UNICODE_STRING lpSystemW;
+ UNICODE_STRING lpAccountW;
+ LPWSTR lpReferencedDomainNameW = NULL;
+
+ RtlCreateUnicodeStringFromAsciiz(&lpSystemW, SystemName);
+ RtlCreateUnicodeStringFromAsciiz(&lpAccountW, AccountName);
+
+ if (ReferencedDomainName)
+ lpReferencedDomainNameW = HeapAlloc(GetProcessHeap(),
+ 0,
+ *hReferencedDomainNameLength * sizeof(WCHAR));
+
+ ret = LookupAccountNameW(lpSystemW.Buffer,
+ lpAccountW.Buffer,
+ Sid,
+ SidLength,
+ lpReferencedDomainNameW,
+ hReferencedDomainNameLength,
+ SidNameUse);
+
+ if (ret && lpReferencedDomainNameW)
+ {
+ WideCharToMultiByte(CP_ACP,
+ 0,
+ lpReferencedDomainNameW,
+ *hReferencedDomainNameLength + 1,
+ ReferencedDomainName,
+ *hReferencedDomainNameLength + 1,
+ NULL,
+ NULL);
+ }
+
+ RtlFreeUnicodeString(&lpSystemW);
+ RtlFreeUnicodeString(&lpAccountW);
+ HeapFree(GetProcessHeap(), 0, lpReferencedDomainNameW);
+
+ return ret;
+}
+
+/**********************************************************************
+ * PrivilegeCheck EXPORTED
+ *
+ * @implemented
+ */
+BOOL WINAPI
+PrivilegeCheck(HANDLE ClientToken,
+ PPRIVILEGE_SET RequiredPrivileges,
+ LPBOOL pfResult)
+{
+ BOOLEAN Result;
+ NTSTATUS Status;
+
+ Status = NtPrivilegeCheck(ClientToken,
+ RequiredPrivileges,
+ &Result);
+ if (!NT_SUCCESS(Status))
+ {
+ SetLastError(RtlNtStatusToDosError(Status));
+ return FALSE;
+ }
+
+ *pfResult = (BOOL)Result;
+
+ return TRUE;
+}
+
+/******************************************************************************
+ * GetSecurityInfoExW EXPORTED
+ */
+DWORD
+WINAPI
+GetSecurityInfoExA(HANDLE hObject,
+ SE_OBJECT_TYPE ObjectType,
+ SECURITY_INFORMATION SecurityInfo,
+ LPCSTR lpProvider,
+ LPCSTR lpProperty,
+ PACTRL_ACCESSA *ppAccessList,
+ PACTRL_AUDITA *ppAuditList,
+ LPSTR *lppOwner,
+ LPSTR *lppGroup)
+{
+ FIXME("%s() not implemented!\n", __FUNCTION__);
+ return ERROR_BAD_PROVIDER;
+}
+
+
+/******************************************************************************
+ * GetSecurityInfoExW EXPORTED
+ */
+DWORD
+WINAPI
+GetSecurityInfoExW(HANDLE hObject,
+ SE_OBJECT_TYPE ObjectType,
+ SECURITY_INFORMATION SecurityInfo,
+ LPCWSTR lpProvider,
+ LPCWSTR lpProperty,
+ PACTRL_ACCESSW *ppAccessList,
+ PACTRL_AUDITW *ppAuditList,
+ LPWSTR *lppOwner,
+ LPWSTR *lppGroup)
+{
+ FIXME("%s() not implemented!\n", __FUNCTION__);
+ return ERROR_BAD_PROVIDER;
+}
+
+/******************************************************************************
+ * BuildExplicitAccessWithNameA [ADVAPI32.@]
+ */
+VOID WINAPI
+BuildExplicitAccessWithNameA(PEXPLICIT_ACCESSA pExplicitAccess,
+ LPSTR pTrusteeName,
+ DWORD AccessPermissions,
+ ACCESS_MODE AccessMode,
+ DWORD Inheritance)
+{
+ pExplicitAccess->grfAccessPermissions = AccessPermissions;
+ pExplicitAccess->grfAccessMode = AccessMode;
+ pExplicitAccess->grfInheritance = Inheritance;
+
+ pExplicitAccess->Trustee.pMultipleTrustee = NULL;
+ pExplicitAccess->Trustee.MultipleTrusteeOperation = NO_MULTIPLE_TRUSTEE;
+ pExplicitAccess->Trustee.TrusteeForm = TRUSTEE_IS_NAME;
+ pExplicitAccess->Trustee.TrusteeType = TRUSTEE_IS_UNKNOWN;
+ pExplicitAccess->Trustee.ptstrName = pTrusteeName;
+}
+
+
+/******************************************************************************
+ * BuildExplicitAccessWithNameW [ADVAPI32.@]
+ */
+VOID WINAPI
+BuildExplicitAccessWithNameW(PEXPLICIT_ACCESSW pExplicitAccess,
+ LPWSTR pTrusteeName,
+ DWORD AccessPermissions,
+ ACCESS_MODE AccessMode,
+ DWORD Inheritance)
+{
+ pExplicitAccess->grfAccessPermissions = AccessPermissions;
+ pExplicitAccess->grfAccessMode = AccessMode;
+ pExplicitAccess->grfInheritance = Inheritance;
+
+ pExplicitAccess->Trustee.pMultipleTrustee = NULL;
+ pExplicitAccess->Trustee.MultipleTrusteeOperation = NO_MULTIPLE_TRUSTEE;
+ pExplicitAccess->Trustee.TrusteeForm = TRUSTEE_IS_NAME;
+ pExplicitAccess->Trustee.TrusteeType = TRUSTEE_IS_UNKNOWN;
+ pExplicitAccess->Trustee.ptstrName = pTrusteeName;
+}
+
+/******************************************************************************
+ * BuildTrusteeWithObjectsAndNameA [ADVAPI32.@]
+ */
+VOID WINAPI BuildTrusteeWithObjectsAndNameA( PTRUSTEEA pTrustee, POBJECTS_AND_NAME_A pObjName,
+ SE_OBJECT_TYPE ObjectType, LPSTR ObjectTypeName,
+ LPSTR InheritedObjectTypeName, LPSTR Name )
+{
+ DWORD ObjectsPresent = 0;
+
+ TRACE("%p %p 0x%08x %p %p %s\n", pTrustee, pObjName,
+ ObjectType, ObjectTypeName, InheritedObjectTypeName, debugstr_a(Name));
+
+ /* Fill the OBJECTS_AND_NAME structure */
+ pObjName->ObjectType = ObjectType;
+ if (ObjectTypeName != NULL)
+ {
+ ObjectsPresent |= ACE_OBJECT_TYPE_PRESENT;
+ }
+
+ pObjName->InheritedObjectTypeName = InheritedObjectTypeName;
+ if (InheritedObjectTypeName != NULL)
+ {
+ ObjectsPresent |= ACE_INHERITED_OBJECT_TYPE_PRESENT;
+ }
+
+ pObjName->ObjectsPresent = ObjectsPresent;
+ pObjName->ptstrName = Name;
+
+ /* Fill the TRUSTEE structure */
+ pTrustee->pMultipleTrustee = NULL;
+ pTrustee->MultipleTrusteeOperation = NO_MULTIPLE_TRUSTEE;
+ pTrustee->TrusteeForm = TRUSTEE_IS_OBJECTS_AND_NAME;
+ pTrustee->TrusteeType = TRUSTEE_IS_UNKNOWN;
+ pTrustee->ptstrName = (LPSTR)pObjName;
+}
+
+/******************************************************************************
+ * BuildTrusteeWithObjectsAndNameW [ADVAPI32.@]
+ */
+VOID WINAPI BuildTrusteeWithObjectsAndNameW( PTRUSTEEW pTrustee, POBJECTS_AND_NAME_W pObjName,
+ SE_OBJECT_TYPE ObjectType, LPWSTR ObjectTypeName,
+ LPWSTR InheritedObjectTypeName, LPWSTR Name )
+{
+ DWORD ObjectsPresent = 0;
+
+ TRACE("%p %p 0x%08x %p %p %s\n", pTrustee, pObjName,
+ ObjectType, ObjectTypeName, InheritedObjectTypeName, debugstr_w(Name));
+
+ /* Fill the OBJECTS_AND_NAME structure */
+ pObjName->ObjectType = ObjectType;
+ if (ObjectTypeName != NULL)
+ {
+ ObjectsPresent |= ACE_OBJECT_TYPE_PRESENT;
+ }
+
+ pObjName->InheritedObjectTypeName = InheritedObjectTypeName;
+ if (InheritedObjectTypeName != NULL)
+ {
+ ObjectsPresent |= ACE_INHERITED_OBJECT_TYPE_PRESENT;
+ }
+
+ pObjName->ObjectsPresent = ObjectsPresent;
+ pObjName->ptstrName = Name;
+
+ /* Fill the TRUSTEE structure */
+ pTrustee->pMultipleTrustee = NULL;
+ pTrustee->MultipleTrusteeOperation = NO_MULTIPLE_TRUSTEE;
+ pTrustee->TrusteeForm = TRUSTEE_IS_OBJECTS_AND_NAME;
+ pTrustee->TrusteeType = TRUSTEE_IS_UNKNOWN;
+ pTrustee->ptstrName = (LPWSTR)pObjName;
+}
+
+/******************************************************************************
+ * BuildTrusteeWithObjectsAndSidA [ADVAPI32.@]
+ */
+VOID WINAPI
+BuildTrusteeWithObjectsAndSidA(PTRUSTEEA pTrustee,
+ POBJECTS_AND_SID pObjSid,
+ GUID *pObjectGuid,
+ GUID *pInheritedObjectGuid,
+ PSID pSid)
+{
+ DWORD ObjectsPresent = 0;
+
+ TRACE("%p %p %p %p %p\n", pTrustee, pObjSid, pObjectGuid, pInheritedObjectGuid, pSid);
+
+ /* Fill the OBJECTS_AND_SID structure */
+ if (pObjectGuid != NULL)
+ {
+ pObjSid->ObjectTypeGuid = *pObjectGuid;
+ ObjectsPresent |= ACE_OBJECT_TYPE_PRESENT;
+ }
+ else
+ {
+ ZeroMemory(&pObjSid->ObjectTypeGuid,
+ sizeof(GUID));
+ }
+
+ if (pInheritedObjectGuid != NULL)
+ {
+ pObjSid->InheritedObjectTypeGuid = *pInheritedObjectGuid;
+ ObjectsPresent |= ACE_INHERITED_OBJECT_TYPE_PRESENT;
+ }
+ else
+ {
+ ZeroMemory(&pObjSid->InheritedObjectTypeGuid,
+ sizeof(GUID));
+ }
+
+ pObjSid->ObjectsPresent = ObjectsPresent;
+ pObjSid->pSid = pSid;
+
+ /* Fill the TRUSTEE structure */
+ pTrustee->pMultipleTrustee = NULL;
+ pTrustee->MultipleTrusteeOperation = NO_MULTIPLE_TRUSTEE;
+ pTrustee->TrusteeForm = TRUSTEE_IS_OBJECTS_AND_SID;
+ pTrustee->TrusteeType = TRUSTEE_IS_UNKNOWN;
+ pTrustee->ptstrName = (LPSTR) pObjSid;
+}
+
+
+/******************************************************************************
+ * BuildTrusteeWithObjectsAndSidW [ADVAPI32.@]
+ */
+VOID WINAPI
+BuildTrusteeWithObjectsAndSidW(PTRUSTEEW pTrustee,
+ POBJECTS_AND_SID pObjSid,
+ GUID *pObjectGuid,
+ GUID *pInheritedObjectGuid,
+ PSID pSid)
+{
+ DWORD ObjectsPresent = 0;
+
+ TRACE("%p %p %p %p %p\n", pTrustee, pObjSid, pObjectGuid, pInheritedObjectGuid, pSid);
+
+ /* Fill the OBJECTS_AND_SID structure */
+ if (pObjectGuid != NULL)
+ {
+ pObjSid->ObjectTypeGuid = *pObjectGuid;
+ ObjectsPresent |= ACE_OBJECT_TYPE_PRESENT;
+ }
+ else
+ {
+ ZeroMemory(&pObjSid->ObjectTypeGuid,
+ sizeof(GUID));
+ }
+
+ if (pInheritedObjectGuid != NULL)
+ {
+ pObjSid->InheritedObjectTypeGuid = *pInheritedObjectGuid;
+ ObjectsPresent |= ACE_INHERITED_OBJECT_TYPE_PRESENT;
+ }
+ else
+ {
+ ZeroMemory(&pObjSid->InheritedObjectTypeGuid,
+ sizeof(GUID));
}
- return TRUE;
+ pObjSid->ObjectsPresent = ObjectsPresent;
+ pObjSid->pSid = pSid;
+
+ /* Fill the TRUSTEE structure */
+ pTrustee->pMultipleTrustee = NULL;
+ pTrustee->MultipleTrusteeOperation = NO_MULTIPLE_TRUSTEE;
+ pTrustee->TrusteeForm = TRUSTEE_IS_OBJECTS_AND_SID;
+ pTrustee->TrusteeType = TRUSTEE_IS_UNKNOWN;
+ pTrustee->ptstrName = (LPWSTR) pObjSid;
}
-/*
- * @unimplemented
+/******************************************************************************
+ * BuildTrusteeWithSidA [ADVAPI32.@]
*/
-BOOL
-WINAPI
-CreateWellKnownSid(IN WELL_KNOWN_SID_TYPE WellKnownSidType,
- IN PSID DomainSid OPTIONAL,
- OUT PSID pSid,
- IN OUT DWORD* cbSid)
+VOID WINAPI
+BuildTrusteeWithSidA(PTRUSTEE_A pTrustee,
+ PSID pSid)
{
- unsigned int i;
- TRACE("(%d, %s, %p, %p)\n", WellKnownSidType, debugstr_sid(DomainSid), pSid, cbSid);
+ TRACE("%p %p\n", pTrustee, pSid);
- if (cbSid == NULL || (DomainSid && !IsValidSid(DomainSid)))
- {
- SetLastError(ERROR_INVALID_PARAMETER);
- return FALSE;
- }
+ pTrustee->pMultipleTrustee = NULL;
+ pTrustee->MultipleTrusteeOperation = NO_MULTIPLE_TRUSTEE;
+ pTrustee->TrusteeForm = TRUSTEE_IS_SID;
+ pTrustee->TrusteeType = TRUSTEE_IS_UNKNOWN;
+ pTrustee->ptstrName = (LPSTR) pSid;
+}
- for (i = 0; i < sizeof(WellKnownSids)/sizeof(WellKnownSids[0]); i++) {
- if (WellKnownSids[i].Type == WellKnownSidType) {
- DWORD length = GetSidLengthRequired(WellKnownSids[i].Sid.SubAuthorityCount);
- if (*cbSid < length)
- {
- *cbSid = length;
- SetLastError(ERROR_INSUFFICIENT_BUFFER);
- return FALSE;
- }
- if (!pSid)
- {
- SetLastError(ERROR_INVALID_PARAMETER);
- return FALSE;
- }
- CopyMemory(pSid, &WellKnownSids[i].Sid.Revision, length);
- *cbSid = length;
- return TRUE;
- }
- }
+/******************************************************************************
+ * BuildTrusteeWithSidW [ADVAPI32.@]
+ */
+VOID WINAPI
+BuildTrusteeWithSidW(PTRUSTEE_W pTrustee,
+ PSID pSid)
+{
+ TRACE("%p %p\n", pTrustee, pSid);
- if (DomainSid == NULL || *GetSidSubAuthorityCount(DomainSid) == SID_MAX_SUB_AUTHORITIES)
- {
- SetLastError(ERROR_INVALID_PARAMETER);
- return FALSE;
- }
+ pTrustee->pMultipleTrustee = NULL;
+ pTrustee->MultipleTrusteeOperation = NO_MULTIPLE_TRUSTEE;
+ pTrustee->TrusteeForm = TRUSTEE_IS_SID;
+ pTrustee->TrusteeType = TRUSTEE_IS_UNKNOWN;
+ pTrustee->ptstrName = (LPWSTR) pSid;
+}
- for (i = 0; i < sizeof(WellKnownRids)/sizeof(WellKnownRids[0]); i++)
- if (WellKnownRids[i].Type == WellKnownSidType) {
- UCHAR domain_subauth = *GetSidSubAuthorityCount(DomainSid);
- DWORD domain_sid_length = GetSidLengthRequired(domain_subauth);
- DWORD output_sid_length = GetSidLengthRequired(domain_subauth + 1);
+/******************************************************************************
+ * BuildTrusteeWithNameA [ADVAPI32.@]
+ */
+VOID WINAPI
+BuildTrusteeWithNameA(PTRUSTEE_A pTrustee,
+ LPSTR name)
+{
+ TRACE("%p %s\n", pTrustee, name);
- if (*cbSid < output_sid_length)
- {
- *cbSid = output_sid_length;
- SetLastError(ERROR_INSUFFICIENT_BUFFER);
- return FALSE;
- }
- if (!pSid)
- {
- SetLastError(ERROR_INVALID_PARAMETER);
- return FALSE;
- }
- CopyMemory(pSid, DomainSid, domain_sid_length);
- (*GetSidSubAuthorityCount(pSid))++;
- (*GetSidSubAuthority(pSid, domain_subauth)) = WellKnownRids[i].Rid;
- *cbSid = output_sid_length;
- return TRUE;
- }
+ pTrustee->pMultipleTrustee = NULL;
+ pTrustee->MultipleTrusteeOperation = NO_MULTIPLE_TRUSTEE;
+ pTrustee->TrusteeForm = TRUSTEE_IS_NAME;
+ pTrustee->TrusteeType = TRUSTEE_IS_UNKNOWN;
+ pTrustee->ptstrName = name;
+}
- SetLastError(ERROR_INVALID_PARAMETER);
- return FALSE;
+/******************************************************************************
+ * BuildTrusteeWithNameW [ADVAPI32.@]
+ */
+VOID WINAPI
+BuildTrusteeWithNameW(PTRUSTEE_W pTrustee,
+ LPWSTR name)
+{
+ TRACE("%p %s\n", pTrustee, name);
+
+ pTrustee->pMultipleTrustee = NULL;
+ pTrustee->MultipleTrusteeOperation = NO_MULTIPLE_TRUSTEE;
+ pTrustee->TrusteeForm = TRUSTEE_IS_NAME;
+ pTrustee->TrusteeType = TRUSTEE_IS_UNKNOWN;
+ pTrustee->ptstrName = name;
}
-/*
- * @unimplemented
+/******************************************************************************
+ * GetTrusteeFormW [ADVAPI32.@]
*/
-BOOL
-WINAPI
-IsWellKnownSid(IN PSID pSid,
- IN WELL_KNOWN_SID_TYPE WellKnownSidType)
+TRUSTEE_FORM WINAPI
+GetTrusteeFormA(PTRUSTEE_A pTrustee)
{
- unsigned int i;
- TRACE("(%s, %d)\n", debugstr_sid(pSid), WellKnownSidType);
+ return pTrustee->TrusteeForm;
+}
- for (i = 0; i < sizeof(WellKnownSids) / sizeof(WellKnownSids[0]); i++)
- {
- if (WellKnownSids[i].Type == WellKnownSidType)
- {
- if (EqualSid(pSid, (PSID)(&WellKnownSids[i].Sid.Revision)))
- return TRUE;
- }
- }
- return FALSE;
+/******************************************************************************
+ * GetTrusteeFormW [ADVAPI32.@]
+ */
+TRUSTEE_FORM WINAPI
+GetTrusteeFormW(PTRUSTEE_W pTrustee)
+{
+ return pTrustee->TrusteeForm;
}
-/*
- * @implemented
+/******************************************************************************
+ * GetTrusteeNameA [ADVAPI32.@]
*/
-BOOL
-WINAPI
-IsValidSid(PSID pSid)
+LPSTR WINAPI
+GetTrusteeNameA(PTRUSTEE_A pTrustee)
{
- return (BOOL)RtlValidSid(pSid);
+ return pTrustee->ptstrName;
}
-/*
- * @implemented
+
+/******************************************************************************
+ * GetTrusteeNameW [ADVAPI32.@]
*/
-BOOL
-WINAPI
-EqualSid(PSID pSid1,
- PSID pSid2)
+LPWSTR WINAPI
+GetTrusteeNameW(PTRUSTEE_W pTrustee)
{
- SetLastError(ERROR_SUCCESS);
- return RtlEqualSid (pSid1, pSid2);
+ return pTrustee->ptstrName;
}
-/*
- * @implemented
+/******************************************************************************
+ * GetTrusteeTypeA [ADVAPI32.@]
*/
-BOOL
-WINAPI
-EqualPrefixSid(PSID pSid1,
- PSID pSid2)
+TRUSTEE_TYPE WINAPI
+GetTrusteeTypeA(PTRUSTEE_A pTrustee)
{
- return RtlEqualPrefixSid (pSid1, pSid2);
+ return pTrustee->TrusteeType;
}
-/*
- * @implemented
+/******************************************************************************
+ * GetTrusteeTypeW [ADVAPI32.@]
*/
-DWORD
-WINAPI
-GetSidLengthRequired(UCHAR nSubAuthorityCount)
+TRUSTEE_TYPE WINAPI
+GetTrusteeTypeW(PTRUSTEE_W pTrustee)
{
- return (DWORD)RtlLengthRequiredSid(nSubAuthorityCount);
+ return pTrustee->TrusteeType;
}
/*
*/
BOOL
WINAPI
-InitializeSid(PSID Sid,
- PSID_IDENTIFIER_AUTHORITY pIdentifierAuthority,
- BYTE nSubAuthorityCount)
+SetAclInformation(PACL pAcl,
+ LPVOID pAclInformation,
+ DWORD nAclInformationLength,
+ ACL_INFORMATION_CLASS dwAclInformationClass)
{
NTSTATUS Status;
- Status = RtlInitializeSid(Sid,
- pIdentifierAuthority,
- nSubAuthorityCount);
+ Status = RtlSetInformationAcl(pAcl,
+ pAclInformation,
+ nAclInformationLength,
+ dwAclInformationClass);
if (!NT_SUCCESS(Status))
{
SetLastError(RtlNtStatusToDosError(Status));
return TRUE;
}
-/*
+/**********************************************************************
+ * SetNamedSecurityInfoA EXPORTED
+ *
* @implemented
*/
-PSID_IDENTIFIER_AUTHORITY
+DWORD
WINAPI
-GetSidIdentifierAuthority(PSID pSid)
+SetNamedSecurityInfoA(LPSTR pObjectName,
+ SE_OBJECT_TYPE ObjectType,
+ SECURITY_INFORMATION SecurityInfo,
+ PSID psidOwner,
+ PSID psidGroup,
+ PACL pDacl,
+ PACL pSacl)
{
- return RtlIdentifierAuthoritySid(pSid);
-}
+ UNICODE_STRING ObjectName;
+ DWORD Ret;
-/*
- * @implemented
- */
-PDWORD
-WINAPI
-GetSidSubAuthority(PSID pSid,
- DWORD nSubAuthority)
-{
- SetLastError(ERROR_SUCCESS);
- return (PDWORD)RtlSubAuthoritySid(pSid, nSubAuthority);
+ if (!RtlCreateUnicodeStringFromAsciiz(&ObjectName, pObjectName))
+ {
+ return ERROR_NOT_ENOUGH_MEMORY;
+ }
+
+ Ret = SetNamedSecurityInfoW(ObjectName.Buffer,
+ ObjectType,
+ SecurityInfo,
+ psidOwner,
+ psidGroup,
+ pDacl,
+ pSacl);
+
+ RtlFreeUnicodeString(&ObjectName);
+
+ return Ret;
}
/*
* @implemented
*/
-PUCHAR
+BOOL
WINAPI
-GetSidSubAuthorityCount(PSID pSid)
+AreAllAccessesGranted(DWORD GrantedAccess,
+ DWORD DesiredAccess)
{
- SetLastError(ERROR_SUCCESS);
- return RtlSubAuthorityCountSid(pSid);
+ return (BOOL)RtlAreAllAccessesGranted(GrantedAccess,
+ DesiredAccess);
}
/*
* @implemented
*/
-DWORD
+BOOL
WINAPI
-GetLengthSid(PSID pSid)
-{
- return (DWORD)RtlLengthSid(pSid);
-}
-
-/**********************************************************************
- * PrivilegeCheck EXPORTED
- *
- * @implemented
- */
-BOOL WINAPI
-PrivilegeCheck(HANDLE ClientToken,
- PPRIVILEGE_SET RequiredPrivileges,
- LPBOOL pfResult)
+AreAnyAccessesGranted(DWORD GrantedAccess,
+ DWORD DesiredAccess)
{
- BOOLEAN Result;
- NTSTATUS Status;
-
- Status = NtPrivilegeCheck(ClientToken,
- RequiredPrivileges,
- &Result);
- if (!NT_SUCCESS(Status))
- {
- SetLastError(RtlNtStatusToDosError(Status));
- return FALSE;
- }
-
- *pfResult = (BOOL)Result;
-
- return TRUE;
+ return (BOOL)RtlAreAnyAccessesGranted(GrantedAccess,
+ DesiredAccess);
}
/******************************************************************************
return TRUE;
}
+/*
+ * @unimplemented
+ */
+BOOL WINAPI
+CreateProcessWithLogonW(LPCWSTR lpUsername,
+ LPCWSTR lpDomain,
+ LPCWSTR lpPassword,
+ DWORD dwLogonFlags,
+ LPCWSTR lpApplicationName,
+ LPWSTR lpCommandLine,
+ DWORD dwCreationFlags,
+ LPVOID lpEnvironment,
+ LPCWSTR lpCurrentDirectory,
+ LPSTARTUPINFOW lpStartupInfo,
+ LPPROCESS_INFORMATION lpProcessInformation)
+{
+ FIXME("%s %s %s 0x%08x %s %s 0x%08x %p %s %p %p stub\n", debugstr_w(lpUsername), debugstr_w(lpDomain),
+ debugstr_w(lpPassword), dwLogonFlags, debugstr_w(lpApplicationName),
+ debugstr_w(lpCommandLine), dwCreationFlags, lpEnvironment, debugstr_w(lpCurrentDirectory),
+ lpStartupInfo, lpProcessInformation);
+
+ return FALSE;
+}
+
+BOOL
+WINAPI
+CreateProcessWithTokenW(IN HANDLE hToken,
+ IN DWORD dwLogonFlags,
+ IN LPCWSTR lpApplicationName OPTIONAL,
+ IN OUT LPWSTR lpCommandLine OPTIONAL,
+ IN DWORD dwCreationFlags,
+ IN LPVOID lpEnvironment OPTIONAL,
+ IN LPCWSTR lpCurrentDirectory OPTIONAL,
+ IN LPSTARTUPINFOW lpStartupInfo,
+ OUT LPPROCESS_INFORMATION lpProcessInfo)
+{
+ UNIMPLEMENTED;
+ return FALSE;
+}
+
/*
* @implemented
*/
BOOL WINAPI
-AllocateLocallyUniqueId(PLUID Luid)
+DuplicateTokenEx(IN HANDLE ExistingTokenHandle,
+ IN DWORD dwDesiredAccess,
+ IN LPSECURITY_ATTRIBUTES lpTokenAttributes OPTIONAL,
+ IN SECURITY_IMPERSONATION_LEVEL ImpersonationLevel,
+ IN TOKEN_TYPE TokenType,
+ OUT PHANDLE DuplicateTokenHandle)
{
+ OBJECT_ATTRIBUTES ObjectAttributes;
NTSTATUS Status;
+ SECURITY_QUALITY_OF_SERVICE Sqos;
- Status = NtAllocateLocallyUniqueId (Luid);
- if (!NT_SUCCESS (Status))
+ TRACE("%p 0x%08x 0x%08x 0x%08x %p\n", ExistingTokenHandle, dwDesiredAccess,
+ ImpersonationLevel, TokenType, DuplicateTokenHandle);
+
+ Sqos.Length = sizeof(SECURITY_QUALITY_OF_SERVICE);
+ Sqos.ImpersonationLevel = ImpersonationLevel;
+ Sqos.ContextTrackingMode = 0;
+ Sqos.EffectiveOnly = FALSE;
+
+ if (lpTokenAttributes != NULL)
+ {
+ InitializeObjectAttributes(&ObjectAttributes,
+ NULL,
+ lpTokenAttributes->bInheritHandle ? OBJ_INHERIT : 0,
+ NULL,
+ lpTokenAttributes->lpSecurityDescriptor);
+ }
+ else
+ {
+ InitializeObjectAttributes(&ObjectAttributes,
+ NULL,
+ 0,
+ NULL,
+ NULL);
+ }
+
+ ObjectAttributes.SecurityQualityOfService = &Sqos;
+
+ Status = NtDuplicateToken(ExistingTokenHandle,
+ dwDesiredAccess,
+ &ObjectAttributes,
+ FALSE,
+ TokenType,
+ DuplicateTokenHandle);
+ if (!NT_SUCCESS(Status))
{
+ ERR("NtDuplicateToken failed: Status %08x\n", Status);
SetLastError(RtlNtStatusToDosError(Status));
return FALSE;
}
+ TRACE("Returning token %p.\n", *DuplicateTokenHandle);
+
return TRUE;
}
+/*
+ * @implemented
+ */
+BOOL WINAPI
+DuplicateToken(IN HANDLE ExistingTokenHandle,
+ IN SECURITY_IMPERSONATION_LEVEL ImpersonationLevel,
+ OUT PHANDLE DuplicateTokenHandle)
+{
+ return DuplicateTokenEx(ExistingTokenHandle,
+ TOKEN_IMPERSONATE | TOKEN_QUERY,
+ NULL,
+ ImpersonationLevel,
+ TokenImpersonation,
+ DuplicateTokenHandle);
+}
+
/******************************************************************************
* ComputeStringSidSize
*/
return bret;
}
+/**********************************************************************
+ * GetNamedSecurityInfoA EXPORTED
+ *
+ * @implemented
+ */
+DWORD
+WINAPI
+GetNamedSecurityInfoA(LPSTR pObjectName,
+ SE_OBJECT_TYPE ObjectType,
+ SECURITY_INFORMATION SecurityInfo,
+ PSID *ppsidOwner,
+ PSID *ppsidGroup,
+ PACL *ppDacl,
+ PACL *ppSacl,
+ PSECURITY_DESCRIPTOR *ppSecurityDescriptor)
+{
+ DWORD len;
+ LPWSTR wstr = NULL;
+ DWORD r;
+
+ TRACE("%s %d %d %p %p %p %p %p\n", pObjectName, ObjectType, SecurityInfo,
+ ppsidOwner, ppsidGroup, ppDacl, ppSacl, ppSecurityDescriptor);
+
+ if( pObjectName )
+ {
+ len = MultiByteToWideChar( CP_ACP, 0, pObjectName, -1, NULL, 0 );
+ wstr = HeapAlloc( GetProcessHeap(), 0, len*sizeof(WCHAR));
+ MultiByteToWideChar( CP_ACP, 0, pObjectName, -1, wstr, len );
+ }
+
+ r = GetNamedSecurityInfoW( wstr, ObjectType, SecurityInfo, ppsidOwner,
+ ppsidGroup, ppDacl, ppSacl, ppSecurityDescriptor );
+
+ HeapFree( GetProcessHeap(), 0, wstr );
+
+ return r;
+}
+
/*
* @unimplemented
*/
if (State->PrefixFlags & FAST486_PREFIX_LOCK)\
{\
Fast486Exception(State, FAST486_EXCEPTION_UD);\
- return FALSE;\
+ return;\
}
#define TOGGLE_OPSIZE(x)\
{
DPRINT1("FAST486 -- Extended opcode 0x%02X is INVALID!\n", Opcode);
Fast486Exception(State, FAST486_EXCEPTION_UD);
- return FALSE;
+ return;
}
FAST486_OPCODE_HANDLER(Fast486ExtOpcodeUnimplemented)
{
DPRINT1("FAST486 -- Extended opcode 0x%02X is UNIMPLEMENTED\n", Opcode);
// Fast486Exception(State, FAST486_EXCEPTION_UD);
- return FALSE;
}
FAST486_OPCODE_HANDLER(Fast486ExtOpcode0F0B)
{
/* Reserved opcode (UD2) */
Fast486Exception(State, FAST486_EXCEPTION_UD);
- return FALSE;
}
FAST486_OPCODE_HANDLER(Fast486ExtOpcodeLar)
{
/* Not recognized */
Fast486Exception(State, FAST486_EXCEPTION_UD);
- return FALSE;
+ return;
}
NO_LOCK_PREFIX();
if (!Fast486ParseModRegRm(State, AddressSize, &ModRegRm))
{
/* Exception occurred */
- return FALSE;
+ return;
}
if (OperandSize)
if (!Fast486ReadModrmDwordOperands(State, &ModRegRm, NULL, &Value))
{
/* Exception occurred */
- return FALSE;
+ return;
}
Selector = LOWORD(Value);
if (!Fast486ReadModrmWordOperands(State, &ModRegRm, NULL, &Selector))
{
/* Exception occurred */
- return FALSE;
+ return;
}
}
if (GET_SEGMENT_INDEX(Selector) >= (State->Gdtr.Size + 1))
{
State->Flags.Zf = FALSE;
- return TRUE;
+ return;
}
/* Read the GDT */
sizeof(GdtEntry)))
{
/* Exception occurred */
- return FALSE;
+ return;
}
}
else
if (GET_SEGMENT_INDEX(Selector) >= (State->Ldtr.Limit + 1))
{
State->Flags.Zf = FALSE;
- return TRUE;
+ return;
}
/* Read the LDT */
sizeof(GdtEntry)))
{
/* Exception occurred */
- return FALSE;
+ return;
}
}
|| (Fast486GetCurrentPrivLevel(State) > GdtEntry.Dpl))
{
State->Flags.Zf = FALSE;
- return TRUE;
+ return;
}
/* Set ZF */
AccessRights = ((PDWORD)&GdtEntry)[1] & 0x00F0FF00;
/* Return the access rights */
- if (OperandSize)
- {
- if (!Fast486WriteModrmDwordOperands(State, &ModRegRm, TRUE, AccessRights))
- {
- /* Exception occurred */
- return FALSE;
- }
- }
- else
- {
- if (!Fast486WriteModrmWordOperands(State, &ModRegRm, TRUE, LOWORD(AccessRights)))
- {
- /* Exception occurred */
- return FALSE;
- }
- }
-
- return TRUE;
+ if (OperandSize) Fast486WriteModrmDwordOperands(State, &ModRegRm, TRUE, AccessRights);
+ else Fast486WriteModrmWordOperands(State, &ModRegRm, TRUE, LOWORD(AccessRights));
}
FAST486_OPCODE_HANDLER(Fast486ExtOpcodeLsl)
{
/* Not recognized */
Fast486Exception(State, FAST486_EXCEPTION_UD);
- return FALSE;
+ return;
}
NO_LOCK_PREFIX();
if (!Fast486ParseModRegRm(State, AddressSize, &ModRegRm))
{
/* Exception occurred */
- return FALSE;
+ return;
}
if (OperandSize)
if (!Fast486ReadModrmDwordOperands(State, &ModRegRm, NULL, &Value))
{
/* Exception occurred */
- return FALSE;
+ return;
}
Selector = LOWORD(Value);
if (!Fast486ReadModrmWordOperands(State, &ModRegRm, NULL, &Selector))
{
/* Exception occurred */
- return FALSE;
+ return;
}
}
if (GET_SEGMENT_INDEX(Selector) >= (State->Gdtr.Size + 1))
{
State->Flags.Zf = FALSE;
- return TRUE;
+ return;
}
/* Read the GDT */
sizeof(GdtEntry)))
{
/* Exception occurred */
- return FALSE;
+ return;
}
}
else
if (GET_SEGMENT_INDEX(Selector) >= (State->Ldtr.Limit + 1))
{
State->Flags.Zf = FALSE;
- return TRUE;
+ return;
}
/* Read the LDT */
sizeof(GdtEntry)))
{
/* Exception occurred */
- return FALSE;
+ return;
}
}
|| (Fast486GetCurrentPrivLevel(State) > GdtEntry.Dpl))
{
State->Flags.Zf = FALSE;
- return TRUE;
+ return;
}
/* Calculate the limit */
/* Set ZF */
State->Flags.Zf = TRUE;
- if (OperandSize)
- {
- /* Return the limit */
- if (!Fast486WriteModrmDwordOperands(State, &ModRegRm, TRUE, Limit))
- {
- /* Exception occurred */
- return FALSE;
- }
- }
- else
- {
- /* Return the limit */
- if (!Fast486WriteModrmWordOperands(State, &ModRegRm, TRUE, LOWORD(Limit)))
- {
- /* Exception occurred */
- return FALSE;
- }
- }
-
- return TRUE;
+ /* Return the limit */
+ if (OperandSize) Fast486WriteModrmDwordOperands(State, &ModRegRm, TRUE, Limit);
+ else Fast486WriteModrmWordOperands(State, &ModRegRm, TRUE, LOWORD(Limit));
}
FAST486_OPCODE_HANDLER(Fast486ExtOpcodeClts)
if (Fast486GetCurrentPrivLevel(State) != 0)
{
Fast486Exception(State, FAST486_EXCEPTION_GP);
- return FALSE;
+ return;
}
/* Clear the task switch bit */
State->ControlRegisters[FAST486_REG_CR0] &= ~FAST486_CR0_TS;
-
- return TRUE;
}
FAST486_OPCODE_HANDLER(Fast486ExtOpcodeStoreControlReg)
if (!Fast486ParseModRegRm(State, AddressSize, &ModRegRm))
{
/* Exception occurred */
- return FALSE;
+ return;
}
/* The current privilege level must be zero */
if (Fast486GetCurrentPrivLevel(State) != 0)
{
Fast486Exception(State, FAST486_EXCEPTION_GP);
- return FALSE;
+ return;
}
if ((ModRegRm.Register == 1) || (ModRegRm.Register > 3))
{
/* CR1, CR4, CR5, CR6 and CR7 don't exist */
Fast486Exception(State, FAST486_EXCEPTION_UD);
- return FALSE;
+ return;
}
if (ModRegRm.Register != 0)
/* Store the value of the control register */
State->GeneralRegs[ModRegRm.SecondRegister].Long = State->ControlRegisters[ModRegRm.Register];
-
- /* Return success */
- return TRUE;
}
FAST486_OPCODE_HANDLER(Fast486ExtOpcodeStoreDebugReg)
if (!Fast486ParseModRegRm(State, AddressSize, &ModRegRm))
{
/* Exception occurred */
- return FALSE;
+ return;
}
/* The current privilege level must be zero */
if (Fast486GetCurrentPrivLevel(State) != 0)
{
Fast486Exception(State, FAST486_EXCEPTION_GP);
- return FALSE;
+ return;
}
if ((ModRegRm.Register == 6) || (ModRegRm.Register == 7))
{
/* Disallow access to debug registers */
Fast486Exception(State, FAST486_EXCEPTION_GP);
- return FALSE;
+ return;
}
/* Store the value of the debug register */
State->GeneralRegs[ModRegRm.SecondRegister].Long = State->DebugRegisters[ModRegRm.Register];
-
- /* Return success */
- return TRUE;
}
FAST486_OPCODE_HANDLER(Fast486ExtOpcodeLoadControlReg)
if (!Fast486ParseModRegRm(State, AddressSize, &ModRegRm))
{
/* Exception occurred */
- return FALSE;
+ return;
}
/* The current privilege level must be zero */
if (Fast486GetCurrentPrivLevel(State) != 0)
{
Fast486Exception(State, FAST486_EXCEPTION_GP);
- return FALSE;
+ return;
}
if ((ModRegRm.Register == 1) || (ModRegRm.Register > 3))
{
/* CR1, CR4, CR5, CR6 and CR7 don't exist */
Fast486Exception(State, FAST486_EXCEPTION_UD);
- return FALSE;
+ return;
}
if (ModRegRm.Register != 0)
{
/* Invalid value */
Fast486Exception(State, FAST486_EXCEPTION_GP);
- return FALSE;
+ return;
}
}
/* Load a value to the control register */
State->ControlRegisters[ModRegRm.Register] = Value;
-
- /* Return success */
- return TRUE;
}
FAST486_OPCODE_HANDLER(Fast486ExtOpcodeLoadDebugReg)
if (!Fast486ParseModRegRm(State, AddressSize, &ModRegRm))
{
/* Exception occurred */
- return FALSE;
+ return;
}
/* The current privilege level must be zero */
if (Fast486GetCurrentPrivLevel(State) != 0)
{
Fast486Exception(State, FAST486_EXCEPTION_GP);
- return FALSE;
+ return;
}
if ((ModRegRm.Register == 6) || (ModRegRm.Register == 7))
{
/* Disallow access to debug registers */
Fast486Exception(State, FAST486_EXCEPTION_GP);
- return FALSE;
+ return;
}
/* Load a value to the debug register */
/* The reserved bits are 0 */
State->DebugRegisters[ModRegRm.Register] &= ~FAST486_DR5_RESERVED;
}
-
- /* Return success */
- return TRUE;
}
FAST486_OPCODE_HANDLER(Fast486ExtOpcodePushFs)
{
/* Call the internal API */
- return Fast486StackPush(State, State->SegmentRegs[FAST486_REG_FS].Selector);
+ Fast486StackPush(State, State->SegmentRegs[FAST486_REG_FS].Selector);
}
FAST486_OPCODE_HANDLER(Fast486ExtOpcodePopFs)
if (!Fast486StackPop(State, &NewSelector))
{
/* Exception occurred */
- return FALSE;
+ return;
}
/* Call the internal API */
- return Fast486LoadSegment(State, FAST486_REG_FS, LOWORD(NewSelector));
+ Fast486LoadSegment(State, FAST486_REG_FS, LOWORD(NewSelector));
}
FAST486_OPCODE_HANDLER(Fast486ExtOpcodeBitTest)
if (!Fast486ParseModRegRm(State, AddressSize, &ModRegRm))
{
/* Exception occurred */
- return FALSE;
+ return;
}
/* Get the bit number */
if (!Fast486ReadModrmDwordOperands(State, &ModRegRm, NULL, &Value))
{
/* Exception occurred */
- return FALSE;
+ return;
}
/* Set CF to the bit value */
if (!Fast486ReadModrmWordOperands(State, &ModRegRm, NULL, &Value))
{
/* Exception occurred */
- return FALSE;
+ return;
}
/* Set CF to the bit value */
State->Flags.Cf = (Value >> BitNumber) & 1;
}
-
- /* Return success */
- return TRUE;
}
FAST486_OPCODE_HANDLER(Fast486ExtOpcodeShld)
if (!Fast486ParseModRegRm(State, AddressSize, &ModRegRm))
{
/* Exception occurred */
- return FALSE;
+ return;
}
if (Opcode == 0xA4)
if (!Fast486FetchByte(State, &Count))
{
/* Exception occurred */
- return FALSE;
+ return;
}
}
else
Count &= 0x1F;
/* Do nothing if the count is zero */
- if (Count == 0) return TRUE;
+ if (Count == 0) return;
if (OperandSize)
{
if (!Fast486ReadModrmDwordOperands(State, &ModRegRm, &Source, &Destination))
{
/* Exception occurred */
- return FALSE;
+ return;
}
/* Calculate the result */
State->Flags.Pf = Fast486CalculateParity(Result);
/* Write back the result */
- return Fast486WriteModrmDwordOperands(State, &ModRegRm, FALSE, Result);
+ Fast486WriteModrmDwordOperands(State, &ModRegRm, FALSE, Result);
}
else
{
if (!Fast486ReadModrmWordOperands(State, &ModRegRm, &Source, &Destination))
{
/* Exception occurred */
- return FALSE;
+ return;
}
DoubleSource = Source | (Source << 16);
State->Flags.Pf = Fast486CalculateParity(Result);
/* Write back the result */
- return Fast486WriteModrmWordOperands(State, &ModRegRm, FALSE, Result);
+ Fast486WriteModrmWordOperands(State, &ModRegRm, FALSE, Result);
}
}
FAST486_OPCODE_HANDLER(Fast486ExtOpcodePushGs)
{
/* Call the internal API */
- return Fast486StackPush(State, State->SegmentRegs[FAST486_REG_GS].Selector);
+ Fast486StackPush(State, State->SegmentRegs[FAST486_REG_GS].Selector);
}
FAST486_OPCODE_HANDLER(Fast486ExtOpcodePopGs)
if (!Fast486StackPop(State, &NewSelector))
{
/* Exception occurred */
- return FALSE;
+ return;
}
/* Call the internal API */
- return Fast486LoadSegment(State, FAST486_REG_GS, LOWORD(NewSelector));
+ Fast486LoadSegment(State, FAST486_REG_GS, LOWORD(NewSelector));
}
FAST486_OPCODE_HANDLER(Fast486ExtOpcodeBts)
if (!Fast486ParseModRegRm(State, AddressSize, &ModRegRm))
{
/* Exception occurred */
- return FALSE;
+ return;
}
/* Get the bit number */
if (!Fast486ReadModrmDwordOperands(State, &ModRegRm, NULL, &Value))
{
/* Exception occurred */
- return FALSE;
+ return;
}
/* Set CF to the bit value */
Value |= 1 << BitNumber;
/* Write back the result */
- if (!Fast486WriteModrmDwordOperands(State, &ModRegRm, FALSE, Value))
- {
- /* Exception occurred */
- return FALSE;
- }
+ Fast486WriteModrmDwordOperands(State, &ModRegRm, FALSE, Value);
}
else
{
if (!Fast486ReadModrmWordOperands(State, &ModRegRm, NULL, &Value))
{
/* Exception occurred */
- return FALSE;
+ return;
}
/* Set CF to the bit value */
Value |= 1 << BitNumber;
/* Write back the result */
- if (!Fast486WriteModrmWordOperands(State, &ModRegRm, FALSE, Value))
- {
- /* Exception occurred */
- return FALSE;
- }
+ Fast486WriteModrmWordOperands(State, &ModRegRm, FALSE, Value);
}
-
- /* Return success */
- return TRUE;
}
FAST486_OPCODE_HANDLER(Fast486ExtOpcodeShrd)
if (!Fast486ParseModRegRm(State, AddressSize, &ModRegRm))
{
/* Exception occurred */
- return FALSE;
+ return;
}
if (Opcode == 0xAC)
if (!Fast486FetchByte(State, &Count))
{
/* Exception occurred */
- return FALSE;
+ return;
}
}
else
Count &= 0x1F;
/* Do nothing if the count is zero */
- if (Count == 0) return TRUE;
+ if (Count == 0) return;
if (OperandSize)
{
if (!Fast486ReadModrmDwordOperands(State, &ModRegRm, &Source, &Destination))
{
/* Exception occurred */
- return FALSE;
+ return;
}
/* Calculate the result */
State->Flags.Pf = Fast486CalculateParity(Result);
/* Write back the result */
- return Fast486WriteModrmDwordOperands(State, &ModRegRm, FALSE, Result);
+ Fast486WriteModrmDwordOperands(State, &ModRegRm, FALSE, Result);
}
else
{
if (!Fast486ReadModrmWordOperands(State, &ModRegRm, &Source, &Destination))
{
/* Exception occurred */
- return FALSE;
+ return;
}
/* Calculate the result */
State->Flags.Pf = Fast486CalculateParity(Result);
/* Write back the result */
- return Fast486WriteModrmWordOperands(State, &ModRegRm, FALSE, Result);
+ Fast486WriteModrmWordOperands(State, &ModRegRm, FALSE, Result);
}
}
if (!Fast486ParseModRegRm(State, AddressSize, &ModRegRm))
{
/* Exception occurred */
- return FALSE;
+ return;
}
if (OperandSize)
(PULONG)&Source))
{
/* Exception occurred */
- return FALSE;
+ return;
}
/* Calculate the result */
State->Flags.Cf = State->Flags.Of = ((Result < -2147483648LL) || (Result > 2147483647LL));
/* Write back the result */
- return Fast486WriteModrmDwordOperands(State, &ModRegRm, TRUE, (ULONG)((LONG)Result));
+ Fast486WriteModrmDwordOperands(State, &ModRegRm, TRUE, (ULONG)((LONG)Result));
}
else
{
(PUSHORT)&Source))
{
/* Exception occurred */
- return FALSE;
+ return;
}
/* Calculate the result */
State->Flags.Cf = State->Flags.Of = ((Result < -32768) || (Result > 32767));
/* Write back the result */
- return Fast486WriteModrmWordOperands(State, &ModRegRm, TRUE, (USHORT)((SHORT)Result));
+ Fast486WriteModrmWordOperands(State, &ModRegRm, TRUE, (USHORT)((SHORT)Result));
}
}
if (!Fast486ParseModRegRm(State, AddressSize, &ModRegRm))
{
/* Exception occurred */
- return FALSE;
+ return;
}
/* Read the operands */
if (!Fast486ReadModrmByteOperands(State, &ModRegRm, &Source, &Destination))
{
/* Exception occurred */
- return FALSE;
+ return;
}
/* Compare AL with the destination */
if (State->Flags.Zf)
{
/* Load the source operand into the destination */
- return Fast486WriteModrmByteOperands(State, &ModRegRm, FALSE, Source);
+ Fast486WriteModrmByteOperands(State, &ModRegRm, FALSE, Source);
}
else
{
/* Load the destination into AL */
State->GeneralRegs[FAST486_REG_EAX].LowByte = Destination;
}
-
- /* Return success */
- return TRUE;
}
FAST486_OPCODE_HANDLER(Fast486ExtOpcodeCmpXchg)
if (!Fast486ParseModRegRm(State, AddressSize, &ModRegRm))
{
/* Exception occurred */
- return FALSE;
+ return;
}
if (OperandSize)
if (!Fast486ReadModrmDwordOperands(State, &ModRegRm, &Source, &Destination))
{
/* Exception occurred */
- return FALSE;
+ return;
}
/* Compare EAX with the destination */
if (State->Flags.Zf)
{
/* Load the source operand into the destination */
- return Fast486WriteModrmDwordOperands(State, &ModRegRm, FALSE, Source);
+ Fast486WriteModrmDwordOperands(State, &ModRegRm, FALSE, Source);
}
else
{
if (!Fast486ReadModrmWordOperands(State, &ModRegRm, &Source, &Destination))
{
/* Exception occurred */
- return FALSE;
+ return;
}
/* Compare AX with the destination */
if (State->Flags.Zf)
{
/* Load the source operand into the destination */
- return Fast486WriteModrmWordOperands(State, &ModRegRm, FALSE, Source);
+ Fast486WriteModrmWordOperands(State, &ModRegRm, FALSE, Source);
}
else
{
State->GeneralRegs[FAST486_REG_EAX].LowWord = Destination;
}
}
-
- /* Return success */
- return TRUE;
}
FAST486_OPCODE_HANDLER(Fast486ExtOpcodeLss)
if (!Fast486ParseModRegRm(State, AddressSize, &ModRegRm))
{
/* Exception occurred */
- return FALSE;
+ return;
}
if (!ModRegRm.Memory)
{
/* Invalid */
Fast486Exception(State, FAST486_EXCEPTION_UD);
- return FALSE;
+ return;
}
if (!Fast486ReadMemory(State,
OperandSize ? 6 : 4))
{
/* Exception occurred */
- return FALSE;
+ return;
}
if (OperandSize)
State->GeneralRegs[ModRegRm.Register].Long = Offset;
/* Load the segment */
- return Fast486LoadSegment(State,
- FAST486_REG_SS,
- Segment);
+ Fast486LoadSegment(State, FAST486_REG_SS, Segment);
}
else
{
State->GeneralRegs[ModRegRm.Register].LowWord = Offset;
/* Load the segment */
- return Fast486LoadSegment(State,
- FAST486_REG_SS,
- Segment);
+ Fast486LoadSegment(State, FAST486_REG_SS, Segment);
}
}
if (!Fast486ParseModRegRm(State, AddressSize, &ModRegRm))
{
/* Exception occurred */
- return FALSE;
+ return;
}
/* Get the bit number */
if (!Fast486ReadModrmDwordOperands(State, &ModRegRm, NULL, &Value))
{
/* Exception occurred */
- return FALSE;
+ return;
}
/* Set CF to the bit value */
Value &= ~(1 << BitNumber);
/* Write back the result */
- if (!Fast486WriteModrmDwordOperands(State, &ModRegRm, FALSE, Value))
- {
- /* Exception occurred */
- return FALSE;
- }
+ Fast486WriteModrmDwordOperands(State, &ModRegRm, FALSE, Value);
}
else
{
if (!Fast486ReadModrmWordOperands(State, &ModRegRm, NULL, &Value))
{
/* Exception occurred */
- return FALSE;
+ return;
}
/* Set CF to the bit value */
Value &= ~(1 << BitNumber);
/* Write back the result */
- if (!Fast486WriteModrmWordOperands(State, &ModRegRm, FALSE, Value))
- {
- /* Exception occurred */
- return FALSE;
- }
+ Fast486WriteModrmWordOperands(State, &ModRegRm, FALSE, Value);
}
-
- /* Return success */
- return TRUE;
}
FAST486_OPCODE_HANDLER(Fast486ExtOpcodeLfsLgs)
if (!Fast486ParseModRegRm(State, AddressSize, &ModRegRm))
{
/* Exception occurred */
- return FALSE;
+ return;
}
if (!ModRegRm.Memory)
{
/* Invalid */
Fast486Exception(State, FAST486_EXCEPTION_UD);
- return FALSE;
+ return;
}
if (!Fast486ReadMemory(State,
OperandSize ? 6 : 4))
{
/* Exception occurred */
- return FALSE;
+ return;
}
if (OperandSize)
State->GeneralRegs[ModRegRm.Register].Long = Offset;
/* Load the segment */
- return Fast486LoadSegment(State,
- (Opcode == 0xB4)
- ? FAST486_REG_FS : FAST486_REG_GS,
- Segment);
+ Fast486LoadSegment(State,
+ (Opcode == 0xB4)
+ ? FAST486_REG_FS : FAST486_REG_GS,
+ Segment);
}
else
{
State->GeneralRegs[ModRegRm.Register].LowWord = Offset;
/* Load the segment */
- return Fast486LoadSegment(State,
- (Opcode == 0xB4)
- ? FAST486_REG_FS : FAST486_REG_GS,
- Segment);
+ Fast486LoadSegment(State,
+ (Opcode == 0xB4)
+ ? FAST486_REG_FS : FAST486_REG_GS,
+ Segment);
}
}
if (!Fast486ParseModRegRm(State, AddressSize, &ModRegRm))
{
/* Exception occurred */
- return FALSE;
+ return;
}
/* Read the operands */
if (!Fast486ReadModrmByteOperands(State, &ModRegRm, NULL, &Value))
{
/* Exception occurred */
- return FALSE;
+ return;
}
/* Write back the zero-extended value */
- return Fast486WriteModrmDwordOperands(State,
- &ModRegRm,
- TRUE,
- (ULONG)Value);
+ Fast486WriteModrmDwordOperands(State,
+ &ModRegRm,
+ TRUE,
+ (ULONG)Value);
}
FAST486_OPCODE_HANDLER(Fast486ExtOpcodeMovzxWord)
if (!Fast486ParseModRegRm(State, AddressSize, &ModRegRm))
{
/* Exception occurred */
- return FALSE;
+ return;
}
/* Read the operands */
if (!Fast486ReadModrmWordOperands(State, &ModRegRm, NULL, &Value))
{
/* Exception occurred */
- return FALSE;
+ return;
}
/* Write back the zero-extended value */
- return Fast486WriteModrmDwordOperands(State,
- &ModRegRm,
- TRUE,
- (ULONG)Value);
+ Fast486WriteModrmDwordOperands(State,
+ &ModRegRm,
+ TRUE,
+ (ULONG)Value);
}
FAST486_OPCODE_HANDLER(Fast486ExtOpcodeBtc)
if (!Fast486ParseModRegRm(State, AddressSize, &ModRegRm))
{
/* Exception occurred */
- return FALSE;
+ return;
}
/* Get the bit number */
if (!Fast486ReadModrmDwordOperands(State, &ModRegRm, NULL, &Value))
{
/* Exception occurred */
- return FALSE;
+ return;
}
/* Set CF to the bit value */
Value ^= 1 << BitNumber;
/* Write back the result */
- if (!Fast486WriteModrmDwordOperands(State, &ModRegRm, FALSE, Value))
- {
- /* Exception occurred */
- return FALSE;
- }
+ Fast486WriteModrmDwordOperands(State, &ModRegRm, FALSE, Value);
}
else
{
if (!Fast486ReadModrmWordOperands(State, &ModRegRm, NULL, &Value))
{
/* Exception occurred */
- return FALSE;
+ return;
}
/* Set CF to the bit value */
Value ^= 1 << BitNumber;
/* Write back the result */
- if (!Fast486WriteModrmWordOperands(State, &ModRegRm, FALSE, Value))
- {
- /* Exception occurred */
- return FALSE;
- }
+ Fast486WriteModrmWordOperands(State, &ModRegRm, FALSE, Value);
}
-
- /* Return success */
- return TRUE;
}
FAST486_OPCODE_HANDLER(Fast486ExtOpcodeBsf)
if (!Fast486ParseModRegRm(State, AddressSize, &ModRegRm))
{
/* Exception occurred */
- return FALSE;
+ return;
}
/* Read the value */
if (!Fast486ReadModrmDwordOperands(State, &ModRegRm, NULL, &Value))
{
/* Exception occurred */
- return FALSE;
+ return;
}
}
else
(PUSHORT)&Value))
{
/* Exception occurred */
- return FALSE;
+ return;
}
}
/* Set ZF */
State->Flags.Zf = (Value == 0);
- if (State->Flags.Zf) return TRUE;
+ if (State->Flags.Zf) return;
for (i = 0; i < DataSize; i++)
{
}
/* Write back the result */
- if (OperandSize)
- {
- if (!Fast486WriteModrmDwordOperands(State, &ModRegRm, TRUE, BitNumber))
- {
- /* Exception occurred */
- return FALSE;
- }
- }
- else
- {
- if (!Fast486WriteModrmWordOperands(State, &ModRegRm, TRUE, LOWORD(BitNumber)))
- {
- /* Exception occurred */
- return FALSE;
- }
- }
-
- return TRUE;
+ if (OperandSize) Fast486WriteModrmDwordOperands(State, &ModRegRm, TRUE, BitNumber);
+ else Fast486WriteModrmWordOperands(State, &ModRegRm, TRUE, LOWORD(BitNumber));
}
FAST486_OPCODE_HANDLER(Fast486ExtOpcodeBsr)
if (!Fast486ParseModRegRm(State, AddressSize, &ModRegRm))
{
/* Exception occurred */
- return FALSE;
+ return;
}
/* Read the value */
if (!Fast486ReadModrmDwordOperands(State, &ModRegRm, NULL, &Value))
{
/* Exception occurred */
- return FALSE;
+ return;
}
}
else
(PUSHORT)&Value))
{
/* Exception occurred */
- return FALSE;
+ return;
}
}
/* Set ZF according to the value */
State->Flags.Zf = (Value == 0);
- if (State->Flags.Zf) return TRUE;
+ if (State->Flags.Zf) return;
for (i = DataSize - 1; i >= 0; i--)
{
}
/* Write back the result */
- if (OperandSize)
- {
- if (!Fast486WriteModrmDwordOperands(State, &ModRegRm, TRUE, BitNumber))
- {
- /* Exception occurred */
- return FALSE;
- }
- }
- else
- {
- if (!Fast486WriteModrmWordOperands(State, &ModRegRm, TRUE, LOWORD(BitNumber)))
- {
- /* Exception occurred */
- return FALSE;
- }
- }
-
- return TRUE;
+ if (OperandSize) Fast486WriteModrmDwordOperands(State, &ModRegRm, TRUE, BitNumber);
+ else Fast486WriteModrmWordOperands(State, &ModRegRm, TRUE, LOWORD(BitNumber));
}
FAST486_OPCODE_HANDLER(Fast486ExtOpcodeMovsxByte)
if (!Fast486ParseModRegRm(State, AddressSize, &ModRegRm))
{
/* Exception occurred */
- return FALSE;
+ return;
}
/* Read the operands */
if (!Fast486ReadModrmByteOperands(State, &ModRegRm, NULL, (PUCHAR)&Value))
{
/* Exception occurred */
- return FALSE;
+ return;
}
/* Write back the sign-extended value */
- return Fast486WriteModrmDwordOperands(State,
- &ModRegRm,
- TRUE,
- (ULONG)((LONG)Value));
+ Fast486WriteModrmDwordOperands(State,
+ &ModRegRm,
+ TRUE,
+ (ULONG)((LONG)Value));
}
FAST486_OPCODE_HANDLER(Fast486ExtOpcodeMovsxWord)
if (!Fast486ParseModRegRm(State, AddressSize, &ModRegRm))
{
/* Exception occurred */
- return FALSE;
+ return;
}
/* Read the operands */
if (!Fast486ReadModrmWordOperands(State, &ModRegRm, NULL, (PUSHORT)&Value))
{
/* Exception occurred */
- return FALSE;
+ return;
}
/* Write back the sign-extended value */
- return Fast486WriteModrmDwordOperands(State,
- &ModRegRm,
- TRUE,
- (ULONG)((LONG)Value));
+ Fast486WriteModrmDwordOperands(State,
+ &ModRegRm,
+ TRUE,
+ (ULONG)((LONG)Value));
}
FAST486_OPCODE_HANDLER(Fast486ExtOpcodeConditionalJmp)
if (!Fast486FetchDword(State, (PULONG)&Offset))
{
/* Exception occurred */
- return FALSE;
+ return;
}
}
else
if (!Fast486FetchWord(State, (PUSHORT)&Value))
{
/* Exception occurred */
- return FALSE;
+ return;
}
/* Sign-extend */
/* Move the instruction pointer */
State->InstPtr.Long += Offset;
}
-
- /* Return success */
- return TRUE;
}
FAST486_OPCODE_HANDLER(Fast486ExtOpcodeConditionalSet)
if (!Fast486ParseModRegRm(State, AddressSize, &ModRegRm))
{
/* Exception occurred */
- return FALSE;
+ return;
}
/* Make sure this is the right instruction */
}
/* Write back the result */
- return Fast486WriteModrmByteOperands(State, &ModRegRm, FALSE, Value);
+ Fast486WriteModrmByteOperands(State, &ModRegRm, FALSE, Value);
}
FAST486_OPCODE_HANDLER(Fast486ExtOpcodeXaddByte)
if (!Fast486ParseModRegRm(State, AddressSize, &ModRegRm))
{
/* Exception occurred */
- return FALSE;
+ return;
}
if (!Fast486ReadModrmByteOperands(State,
&Destination))
{
/* Exception occurred */
- return FALSE;
+ return;
}
/* Calculate the result */
if (!Fast486WriteModrmByteOperands(State, &ModRegRm, FALSE, Result))
{
/* Exception occurred */
- return FALSE;
+ return;
}
/* Write the old value of the destination to the source */
- if (!Fast486WriteModrmByteOperands(State, &ModRegRm, TRUE, Destination))
- {
- /* Exception occurred */
- return FALSE;
- }
-
- return TRUE;
+ Fast486WriteModrmByteOperands(State, &ModRegRm, TRUE, Destination);
}
FAST486_OPCODE_HANDLER(Fast486ExtOpcodeXadd)
if (!Fast486ParseModRegRm(State, AddressSize, &ModRegRm))
{
/* Exception occurred */
- return FALSE;
+ return;
}
/* Check the operand size */
&Destination))
{
/* Exception occurred */
- return FALSE;
+ return;
}
/* Calculate the result */
if (!Fast486WriteModrmDwordOperands(State, &ModRegRm, TRUE, Destination))
{
/* Exception occurred */
- return FALSE;
+ return;
}
/* Write the sum to the destination */
- if (!Fast486WriteModrmDwordOperands(State, &ModRegRm, FALSE, Result))
- {
- /* Exception occurred */
- return FALSE;
- }
+ Fast486WriteModrmDwordOperands(State, &ModRegRm, FALSE, Result);
}
else
{
&Destination))
{
/* Exception occurred */
- return FALSE;
+ return;
}
/* Calculate the result */
if (!Fast486WriteModrmWordOperands(State, &ModRegRm, TRUE, Destination))
{
/* Exception occurred */
- return FALSE;
+ return;
}
/* Write the sum to the destination */
- if (!Fast486WriteModrmWordOperands(State, &ModRegRm, FALSE, Result))
- {
- /* Exception occurred */
- return FALSE;
- }
+ Fast486WriteModrmWordOperands(State, &ModRegRm, FALSE, Result);
}
-
- return TRUE;
}
FAST486_OPCODE_HANDLER(Fast486ExtOpcodeBswap)
/* Swap the byte order */
SWAP(Pointer[0], Pointer[3]);
SWAP(Pointer[1], Pointer[2]);
-
- /* Return success */
- return TRUE;
}
FAST486_OPCODE_HANDLER(Fast486OpcodeExtended)
if (!Fast486FetchByte(State, &SecondOpcode))
{
/* Exception occurred */
- return FALSE;
+ return;
}
/* Call the extended opcode handler */
- return Fast486ExtendedHandlers[SecondOpcode](State, SecondOpcode);
+ Fast486ExtendedHandlers[SecondOpcode](State, SecondOpcode);
}
/* EOF */
if (!Fast486ParseModRegRm(State, AddressSize, &ModRegRm))
{
/* Exception occurred */
- return FALSE;
+ return;
}
FPU_CHECK();
sizeof(ULONGLONG)))
{
/* Exception occurred */
- return FALSE;
+ return;
}
Fast486FpuGetDoubleReal(State, Value, &MemoryData);
if (!Fast486ReadModrmDwordOperands(State, &ModRegRm, NULL, &Value))
{
/* Exception occurred */
- return FALSE;
+ return;
}
Fast486FpuGetSingleReal(State, Value, &MemoryData);
{
/* Invalid operation */
State->FpuStatus.Ie = TRUE;
- return FALSE;
+ return;
}
}
{
/* Invalid operation */
State->FpuStatus.Ie = TRUE;
- return FALSE;
+ return;
}
/* Check the operation */
}
#endif
-
- return TRUE;
}
FAST486_OPCODE_HANDLER(Fast486FpuOpcodeD9)
if (!Fast486ParseModRegRm(State, AddressSize, &ModRegRm))
{
/* Exception occurred */
- return FALSE;
+ return;
}
FPU_CHECK();
#ifndef FAST486_NO_FPU
// TODO: NOT IMPLEMENTED
UNIMPLEMENTED;
-
- return FALSE;
#else
/* Do nothing */
- return TRUE;
#endif
}
if (!Fast486ParseModRegRm(State, AddressSize, &ModRegRm))
{
/* Exception occurred */
- return FALSE;
+ return;
}
FPU_CHECK();
#ifndef FAST486_NO_FPU
// TODO: NOT IMPLEMENTED
UNIMPLEMENTED;
-
- return FALSE;
#else
/* Do nothing */
- return TRUE;
#endif
}
if (!Fast486ParseModRegRm(State, AddressSize, &ModRegRm))
{
/* Exception occurred */
- return FALSE;
+ return;
}
FPU_CHECK();
default:
{
Fast486Exception(State, FAST486_EXCEPTION_UD);
- return FALSE;
}
}
}
#endif
-
- return TRUE;
}
FAST486_OPCODE_HANDLER(Fast486FpuOpcodeDD)
if (!Fast486ParseModRegRm(State, AddressSize, &ModRegRm))
{
/* Exception occurred */
- return FALSE;
+ return;
}
FPU_CHECK();
#ifndef FAST486_NO_FPU
// TODO: NOT IMPLEMENTED
UNIMPLEMENTED;
-
- return FALSE;
#else
/* Do nothing */
- return TRUE;
#endif
}
if (!Fast486ParseModRegRm(State, AddressSize, &ModRegRm))
{
/* Exception occurred */
- return FALSE;
+ return;
}
FPU_CHECK();
#ifndef FAST486_NO_FPU
// TODO: NOT IMPLEMENTED
UNIMPLEMENTED;
-
- return FALSE;
#else
/* Do nothing */
- return TRUE;
#endif
}
if (!Fast486ParseModRegRm(State, AddressSize, &ModRegRm))
{
/* Exception occurred */
- return FALSE;
+ return;
}
FPU_CHECK();
#ifndef FAST486_NO_FPU
// TODO: NOT IMPLEMENTED
UNIMPLEMENTED;
-
- return FALSE;
#else
/* Do nothing */
- return TRUE;
#endif
}
#define FPU_CHECK() if (State->ControlRegisters[FAST486_REG_CR0] & FAST486_CR0_EM) \
{ \
Fast486Exception(State, FAST486_EXCEPTION_NM); \
- return FALSE; \
+ return; \
}
#define FPU_ST(i) State->FpuRegisters[(State->FpuStatus.Top + (i)) % FAST486_NUM_FPU_REGS]
#define FPU_GET_TAG(i) ((State->FpuTag >> ((i) * 2)) & 3)
*/
DPRINT1("FAST486 -- Calling ICEBP opcode\n");
Fast486Exception(State, FAST486_EXCEPTION_UD);
- return FALSE;
}
FAST486_OPCODE_HANDLER(Fast486OpcodePrefix)
/* Throw an exception */
Fast486Exception(State, FAST486_EXCEPTION_UD);
- return FALSE;
}
-
- return TRUE;
}
FAST486_OPCODE_HANDLER(Fast486OpcodeIncrement)
State->Flags.Zf = (Value == 0);
State->Flags.Af = ((Value & 0x0F) == 0);
State->Flags.Pf = Fast486CalculateParity(LOBYTE(Value));
-
- /* Return success */
- return TRUE;
}
FAST486_OPCODE_HANDLER(Fast486OpcodeDecrement)
State->Flags.Zf = (Value == 0);
State->Flags.Af = ((Value & 0x0F) == 0x0F);
State->Flags.Pf = Fast486CalculateParity(LOBYTE(Value));
-
- /* Return success */
- return TRUE;
}
FAST486_OPCODE_HANDLER(Fast486OpcodePushReg)
ASSERT((Opcode & 0xF8) == 0x50);
/* Call the internal function */
- return Fast486StackPush(State, State->GeneralRegs[Opcode & 0x07].Long);
+ Fast486StackPush(State, State->GeneralRegs[Opcode & 0x07].Long);
}
FAST486_OPCODE_HANDLER(Fast486OpcodePopReg)
ASSERT((Opcode & 0xF8) == 0x58);
/* Call the internal function */
- if (!Fast486StackPop(State, &Value)) return FALSE;
+ if (!Fast486StackPop(State, &Value)) return;
/* Store the value */
if (Size) State->GeneralRegs[Opcode & 0x07].Long = Value;
else State->GeneralRegs[Opcode & 0x07].LowWord = Value;
-
- /* Return success */
- return TRUE;
}
FAST486_OPCODE_HANDLER(Fast486OpcodeNop)
{
- return TRUE;
}
FAST486_OPCODE_HANDLER(Fast486OpcodeExchangeEax)
State->GeneralRegs[Reg].LowWord = State->GeneralRegs[FAST486_REG_EAX].LowWord;
State->GeneralRegs[FAST486_REG_EAX].LowWord = Value;
}
-
- return TRUE;
}
FAST486_OPCODE_HANDLER(Fast486OpcodeShortConditionalJmp)
if (!Fast486FetchByte(State, (PUCHAR)&Offset))
{
/* An exception occurred */
- return FALSE;
+ return;
}
switch ((Opcode & 0x0F) >> 1)
State->InstPtr.Long &= 0xFFFF;
}
}
-
- /* Return success */
- return TRUE;
}
FAST486_OPCODE_HANDLER(Fast486OpcodeClearCarry)
if (State->PrefixFlags)
{
Fast486Exception(State, FAST486_EXCEPTION_UD);
- return FALSE;
+ return;
}
/* Clear CF and return success */
State->Flags.Cf = FALSE;
- return TRUE;
}
FAST486_OPCODE_HANDLER(Fast486OpcodeSetCarry)
if (State->PrefixFlags)
{
Fast486Exception(State, FAST486_EXCEPTION_UD);
- return FALSE;
+ return;
}
/* Set CF and return success*/
State->Flags.Cf = TRUE;
- return TRUE;
}
FAST486_OPCODE_HANDLER(Fast486OpcodeComplCarry)
if (State->PrefixFlags)
{
Fast486Exception(State, FAST486_EXCEPTION_UD);
- return FALSE;
+ return;
}
/* Toggle CF and return success */
State->Flags.Cf = !State->Flags.Cf;
- return TRUE;
+ return;
}
FAST486_OPCODE_HANDLER(Fast486OpcodeClearInt)
if (State->PrefixFlags)
{
Fast486Exception(State, FAST486_EXCEPTION_UD);
- return FALSE;
+ return;
}
/* Check for protected mode */
{
/* General Protection Fault */
Fast486Exception(State, FAST486_EXCEPTION_GP);
- return FALSE;
+ return;
}
}
else
/* Just clear the interrupt flag */
State->Flags.If = FALSE;
}
-
- /* Return success */
- return TRUE;
}
FAST486_OPCODE_HANDLER(Fast486OpcodeSetInt)
if (State->PrefixFlags)
{
Fast486Exception(State, FAST486_EXCEPTION_UD);
- return FALSE;
+ return;
}
/* Check for protected mode */
{
/* General Protection Fault */
Fast486Exception(State, FAST486_EXCEPTION_GP);
- return FALSE;
+ return;
}
}
else
/* Just set the interrupt flag */
State->Flags.If = TRUE;
}
-
- /* Return success */
- return TRUE;
}
FAST486_OPCODE_HANDLER(Fast486OpcodeClearDir)
if (State->PrefixFlags)
{
Fast486Exception(State, FAST486_EXCEPTION_UD);
- return FALSE;
+ return;
}
- /* Clear DF and return success */
+ /* Clear DF */
State->Flags.Df = FALSE;
- return TRUE;
}
FAST486_OPCODE_HANDLER(Fast486OpcodeSetDir)
if (State->PrefixFlags)
{
Fast486Exception(State, FAST486_EXCEPTION_UD);
- return FALSE;
+ return;
}
- /* Set DF and return success*/
+ /* Set DF */
State->Flags.Df = TRUE;
- return TRUE;
}
FAST486_OPCODE_HANDLER(Fast486OpcodeHalt)
if (State->PrefixFlags)
{
Fast486Exception(State, FAST486_EXCEPTION_UD);
- return FALSE;
+ return;
}
/* Privileged instructions can only be executed under CPL = 0 */
if (State->SegmentRegs[FAST486_REG_CS].Dpl != 0)
{
Fast486Exception(State, FAST486_EXCEPTION_GP);
- return FALSE;
+ return;
}
/* Halt */
State->Halted = TRUE;
-
- /* Return success */
- return TRUE;
}
FAST486_OPCODE_HANDLER(Fast486OpcodeInByte)
if (!Fast486FetchByte(State, &Data))
{
/* Exception occurred */
- return FALSE;
+ return;
}
/* Set the port number to the parameter */
/* Store the result in AL */
State->GeneralRegs[FAST486_REG_EAX].LowByte = Data;
-
- return TRUE;
}
FAST486_OPCODE_HANDLER(Fast486OpcodeIn)
if (!Fast486FetchByte(State, &Data))
{
/* Exception occurred */
- return FALSE;
+ return;
}
/* Set the port number to the parameter */
/* Store the value in AX */
State->GeneralRegs[FAST486_REG_EAX].LowWord = Data;
}
-
- return TRUE;
}
FAST486_OPCODE_HANDLER(Fast486OpcodeOutByte)
if (!Fast486FetchByte(State, &Data))
{
/* Exception occurred */
- return FALSE;
+ return;
}
/* Set the port number to the parameter */
/* Write the byte to the I/O port */
State->IoWriteCallback(State, Port, &Data, 1, sizeof(UCHAR));
-
- return TRUE;
}
FAST486_OPCODE_HANDLER(Fast486OpcodeOut)
if (!Fast486FetchByte(State, &Data))
{
/* Exception occurred */
- return FALSE;
+ return;
}
/* Set the port number to the parameter */
/* Write a word to the I/O port */
State->IoWriteCallback(State, Port, &Data, 1, sizeof(USHORT));
}
-
- return TRUE;
}
FAST486_OPCODE_HANDLER(Fast486OpcodeShortJump)
if (!Fast486FetchByte(State, (PUCHAR)&Offset))
{
/* An exception occurred */
- return FALSE;
+ return;
}
/* Move the instruction pointer */
/* Clear the top half of EIP */
State->InstPtr.Long &= 0xFFFF;
}
-
- return TRUE;
}
FAST486_OPCODE_HANDLER(Fast486OpcodeMovRegImm)
if (!Fast486FetchDword(State, &Value))
{
/* Exception occurred */
- return FALSE;
+ return;
}
/* Store the value in the register */
if (!Fast486FetchWord(State, &Value))
{
/* Exception occurred */
- return FALSE;
+ return;
}
/* Store the value in the register */
State->GeneralRegs[Opcode & 0x07].LowWord = Value;
}
-
- return TRUE;
}
FAST486_OPCODE_HANDLER(Fast486OpcodeMovByteRegImm)
{
/* Invalid prefix */
Fast486Exception(State, FAST486_EXCEPTION_UD);
- return FALSE;
+ return;
}
/* Fetch the byte */
if (!Fast486FetchByte(State, &Value))
{
/* Exception occurred */
- return FALSE;
+ return;
}
if (Opcode & 0x04)
/* AL, CL, DL or BL */
State->GeneralRegs[Opcode & 0x03].LowByte = Value;
}
-
- return TRUE;
}
FAST486_OPCODE_HANDLER(Fast486OpcodeAddByteModrm)
if (!Fast486ParseModRegRm(State, AddressSize, &ModRegRm))
{
/* Exception occurred */
- return FALSE;
+ return;
}
if (!Fast486ReadModrmByteOperands(State,
&SecondValue))
{
/* Exception occurred */
- return FALSE;
+ return;
}
/* Calculate the result */
State->Flags.Pf = Fast486CalculateParity(Result);
/* Write back the result */
- return Fast486WriteModrmByteOperands(State,
- &ModRegRm,
- Opcode & FAST486_OPCODE_WRITE_REG,
- Result);
+ Fast486WriteModrmByteOperands(State,
+ &ModRegRm,
+ Opcode & FAST486_OPCODE_WRITE_REG,
+ Result);
}
FAST486_OPCODE_HANDLER(Fast486OpcodeAddModrm)
if (!Fast486ParseModRegRm(State, AddressSize, &ModRegRm))
{
/* Exception occurred */
- return FALSE;
+ return;
}
/* Check the operand size */
&SecondValue))
{
/* Exception occurred */
- return FALSE;
+ return;
}
/* Calculate the result */
State->Flags.Pf = Fast486CalculateParity(Result);
/* Write back the result */
- return Fast486WriteModrmDwordOperands(State,
- &ModRegRm,
- Opcode & FAST486_OPCODE_WRITE_REG,
- Result);
+ Fast486WriteModrmDwordOperands(State,
+ &ModRegRm,
+ Opcode & FAST486_OPCODE_WRITE_REG,
+ Result);
}
else
{
&SecondValue))
{
/* Exception occurred */
- return FALSE;
+ return;
}
/* Calculate the result */
State->Flags.Pf = Fast486CalculateParity(Result);
/* Write back the result */
- return Fast486WriteModrmWordOperands(State,
- &ModRegRm,
- Opcode & FAST486_OPCODE_WRITE_REG,
- Result);
+ Fast486WriteModrmWordOperands(State,
+ &ModRegRm,
+ Opcode & FAST486_OPCODE_WRITE_REG,
+ Result);
}
}
{
/* This opcode doesn't take any prefixes */
Fast486Exception(State, FAST486_EXCEPTION_UD);
- return FALSE;
+ return;
}
if (!Fast486FetchByte(State, &SecondValue))
{
/* Exception occurred */
- return FALSE;
+ return;
}
/* Calculate the result */
/* Write back the result */
State->GeneralRegs[FAST486_REG_EAX].LowByte = Result;
-
- return TRUE;
}
FAST486_OPCODE_HANDLER(Fast486OpcodeAddEax)
if (!Fast486FetchDword(State, &SecondValue))
{
/* Exception occurred */
- return FALSE;
+ return;
}
/* Calculate the result */
if (!Fast486FetchWord(State, &SecondValue))
{
/* Exception occurred */
- return FALSE;
+ return;
}
/* Calculate the result */
/* Write back the result */
State->GeneralRegs[FAST486_REG_EAX].LowWord = Result;
}
-
- return TRUE;
}
FAST486_OPCODE_HANDLER(Fast486OpcodeOrByteModrm)
if (!Fast486ParseModRegRm(State, AddressSize, &ModRegRm))
{
/* Exception occurred */
- return FALSE;
+ return;
}
if (!Fast486ReadModrmByteOperands(State,
&SecondValue))
{
/* Exception occurred */
- return FALSE;
+ return;
}
/* Calculate the result */
State->Flags.Pf = Fast486CalculateParity(Result);
/* Write back the result */
- return Fast486WriteModrmByteOperands(State,
- &ModRegRm,
- Opcode & FAST486_OPCODE_WRITE_REG,
- Result);
+ Fast486WriteModrmByteOperands(State,
+ &ModRegRm,
+ Opcode & FAST486_OPCODE_WRITE_REG,
+ Result);
}
FAST486_OPCODE_HANDLER(Fast486OpcodeOrModrm)
if (!Fast486ParseModRegRm(State, AddressSize, &ModRegRm))
{
/* Exception occurred */
- return FALSE;
+ return;
}
/* Check the operand size */
&SecondValue))
{
/* Exception occurred */
- return FALSE;
+ return;
}
/* Calculate the result */
State->Flags.Pf = Fast486CalculateParity(Result);
/* Write back the result */
- return Fast486WriteModrmDwordOperands(State,
- &ModRegRm,
- Opcode & FAST486_OPCODE_WRITE_REG,
- Result);
+ Fast486WriteModrmDwordOperands(State,
+ &ModRegRm,
+ Opcode & FAST486_OPCODE_WRITE_REG,
+ Result);
}
else
{
&SecondValue))
{
/* Exception occurred */
- return FALSE;
+ return;
}
/* Calculate the result */
State->Flags.Pf = Fast486CalculateParity(Result);
/* Write back the result */
- return Fast486WriteModrmWordOperands(State,
- &ModRegRm,
- Opcode & FAST486_OPCODE_WRITE_REG,
- Result);
+ Fast486WriteModrmWordOperands(State,
+ &ModRegRm,
+ Opcode & FAST486_OPCODE_WRITE_REG,
+ Result);
}
}
{
/* This opcode doesn't take any prefixes */
Fast486Exception(State, FAST486_EXCEPTION_UD);
- return FALSE;
+ return;
}
if (!Fast486FetchByte(State, &SecondValue))
{
/* Exception occurred */
- return FALSE;
+ return;
}
/* Calculate the result */
/* Write back the result */
State->GeneralRegs[FAST486_REG_EAX].LowByte = Result;
-
- return TRUE;
}
FAST486_OPCODE_HANDLER(Fast486OpcodeOrEax)
if (!Fast486FetchDword(State, &SecondValue))
{
/* Exception occurred */
- return FALSE;
+ return;
}
/* Calculate the result */
if (!Fast486FetchWord(State, &SecondValue))
{
/* Exception occurred */
- return FALSE;
+ return;
}
/* Calculate the result */
/* Write back the result */
State->GeneralRegs[FAST486_REG_EAX].LowWord = Result;
}
-
- return TRUE;
}
FAST486_OPCODE_HANDLER(Fast486OpcodeAndByteModrm)
if (!Fast486ParseModRegRm(State, AddressSize, &ModRegRm))
{
/* Exception occurred */
- return FALSE;
+ return;
}
if (!Fast486ReadModrmByteOperands(State,
&SecondValue))
{
/* Exception occurred */
- return FALSE;
+ return;
}
/* Calculate the result */
State->Flags.Pf = Fast486CalculateParity(Result);
/* Write back the result */
- return Fast486WriteModrmByteOperands(State,
- &ModRegRm,
- Opcode & FAST486_OPCODE_WRITE_REG,
- Result);
+ Fast486WriteModrmByteOperands(State,
+ &ModRegRm,
+ Opcode & FAST486_OPCODE_WRITE_REG,
+ Result);
}
FAST486_OPCODE_HANDLER(Fast486OpcodeAndModrm)
if (!Fast486ParseModRegRm(State, AddressSize, &ModRegRm))
{
/* Exception occurred */
- return FALSE;
+ return;
}
/* Check the operand size */
&SecondValue))
{
/* Exception occurred */
- return FALSE;
+ return;
}
/* Calculate the result */
State->Flags.Pf = Fast486CalculateParity(Result);
/* Write back the result */
- return Fast486WriteModrmDwordOperands(State,
- &ModRegRm,
- Opcode & FAST486_OPCODE_WRITE_REG,
- Result);
+ Fast486WriteModrmDwordOperands(State,
+ &ModRegRm,
+ Opcode & FAST486_OPCODE_WRITE_REG,
+ Result);
}
else
{
&SecondValue))
{
/* Exception occurred */
- return FALSE;
+ return;
}
/* Calculate the result */
State->Flags.Pf = Fast486CalculateParity(Result);
/* Write back the result */
- return Fast486WriteModrmWordOperands(State,
- &ModRegRm,
- Opcode & FAST486_OPCODE_WRITE_REG,
- Result);
+ Fast486WriteModrmWordOperands(State,
+ &ModRegRm,
+ Opcode & FAST486_OPCODE_WRITE_REG,
+ Result);
}
}
if (!Fast486FetchByte(State, &SecondValue))
{
/* Exception occurred */
- return FALSE;
+ return;
}
/* Calculate the result */
/* Write back the result */
State->GeneralRegs[FAST486_REG_EAX].LowByte = Result;
-
- return TRUE;
}
FAST486_OPCODE_HANDLER(Fast486OpcodeAndEax)
if (!Fast486FetchDword(State, &SecondValue))
{
/* Exception occurred */
- return FALSE;
+ return;
}
/* Calculate the result */
if (!Fast486FetchWord(State, &SecondValue))
{
/* Exception occurred */
- return FALSE;
+ return;
}
/* Calculate the result */
/* Write back the result */
State->GeneralRegs[FAST486_REG_EAX].LowWord = Result;
}
-
- return TRUE;
}
FAST486_OPCODE_HANDLER(Fast486OpcodeXorByteModrm)
if (!Fast486ParseModRegRm(State, AddressSize, &ModRegRm))
{
/* Exception occurred */
- return FALSE;
+ return;
}
if (!Fast486ReadModrmByteOperands(State,
&SecondValue))
{
/* Exception occurred */
- return FALSE;
+ return;
}
/* Calculate the result */
State->Flags.Pf = Fast486CalculateParity(Result);
/* Write back the result */
- return Fast486WriteModrmByteOperands(State,
- &ModRegRm,
- Opcode & FAST486_OPCODE_WRITE_REG,
- Result);
+ Fast486WriteModrmByteOperands(State,
+ &ModRegRm,
+ Opcode & FAST486_OPCODE_WRITE_REG,
+ Result);
}
FAST486_OPCODE_HANDLER(Fast486OpcodeXorModrm)
if (!Fast486ParseModRegRm(State, AddressSize, &ModRegRm))
{
/* Exception occurred */
- return FALSE;
+ return;
}
/* Check the operand size */
&SecondValue))
{
/* Exception occurred */
- return FALSE;
+ return;
}
/* Calculate the result */
State->Flags.Pf = Fast486CalculateParity(Result);
/* Write back the result */
- return Fast486WriteModrmDwordOperands(State,
- &ModRegRm,
- Opcode & FAST486_OPCODE_WRITE_REG,
- Result);
+ Fast486WriteModrmDwordOperands(State,
+ &ModRegRm,
+ Opcode & FAST486_OPCODE_WRITE_REG,
+ Result);
}
else
{
&SecondValue))
{
/* Exception occurred */
- return FALSE;
+ return;
}
/* Calculate the result */
State->Flags.Pf = Fast486CalculateParity(Result);
/* Write back the result */
- return Fast486WriteModrmWordOperands(State,
- &ModRegRm,
- Opcode & FAST486_OPCODE_WRITE_REG,
- Result);
+ Fast486WriteModrmWordOperands(State,
+ &ModRegRm,
+ Opcode & FAST486_OPCODE_WRITE_REG,
+ Result);
}
}
{
/* This opcode doesn't take any prefixes */
Fast486Exception(State, FAST486_EXCEPTION_UD);
- return FALSE;
+ return;
}
if (!Fast486FetchByte(State, &SecondValue))
{
/* Exception occurred */
- return FALSE;
+ return;
}
/* Calculate the result */
/* Write back the result */
State->GeneralRegs[FAST486_REG_EAX].LowByte = Result;
-
- return TRUE;
}
FAST486_OPCODE_HANDLER(Fast486OpcodeXorEax)
if (!Fast486FetchDword(State, &SecondValue))
{
/* Exception occurred */
- return FALSE;
+ return;
}
/* Calculate the result */
if (!Fast486FetchWord(State, &SecondValue))
{
/* Exception occurred */
- return FALSE;
+ return;
}
/* Calculate the result */
/* Write back the result */
State->GeneralRegs[FAST486_REG_EAX].LowWord = Result;
}
-
- return TRUE;
}
FAST486_OPCODE_HANDLER(Fast486OpcodeTestByteModrm)
if (!Fast486ParseModRegRm(State, AddressSize, &ModRegRm))
{
/* Exception occurred */
- return FALSE;
+ return;
}
if (!Fast486ReadModrmByteOperands(State,
&SecondValue))
{
/* Exception occurred */
- return FALSE;
+ return;
}
/* Calculate the result */
Result = FirstValue & SecondValue;
State->Flags.Zf = (Result == 0);
State->Flags.Sf = ((Result & SIGN_FLAG_BYTE) != 0);
State->Flags.Pf = Fast486CalculateParity(Result);
-
- /* The result is discarded */
- return TRUE;
}
FAST486_OPCODE_HANDLER(Fast486OpcodeTestModrm)
if (!Fast486ParseModRegRm(State, AddressSize, &ModRegRm))
{
/* Exception occurred */
- return FALSE;
+ return;
}
/* Check the operand size */
&SecondValue))
{
/* Exception occurred */
- return FALSE;
+ return;
}
/* Calculate the result */
&SecondValue))
{
/* Exception occurred */
- return FALSE;
+ return;
}
/* Calculate the result */
State->Flags.Sf = ((Result & SIGN_FLAG_WORD) != 0);
State->Flags.Pf = Fast486CalculateParity(Result);
}
-
- /* The result is discarded */
- return TRUE;
}
FAST486_OPCODE_HANDLER(Fast486OpcodeTestAl)
{
/* This opcode doesn't take any prefixes */
Fast486Exception(State, FAST486_EXCEPTION_UD);
- return FALSE;
+ return;
}
if (!Fast486FetchByte(State, &SecondValue))
{
/* Exception occurred */
- return FALSE;
+ return;
}
/* Calculate the result */
State->Flags.Zf = (Result == 0);
State->Flags.Sf = ((Result & SIGN_FLAG_BYTE) != 0);
State->Flags.Pf = Fast486CalculateParity(Result);
-
- /* The result is discarded */
- return TRUE;
}
FAST486_OPCODE_HANDLER(Fast486OpcodeTestEax)
if (!Fast486FetchDword(State, &SecondValue))
{
/* Exception occurred */
- return FALSE;
+ return;
}
/* Calculate the result */
if (!Fast486FetchWord(State, &SecondValue))
{
/* Exception occurred */
- return FALSE;
+ return;
}
/* Calculate the result */
State->Flags.Sf = ((Result & SIGN_FLAG_WORD) != 0);
State->Flags.Pf = Fast486CalculateParity(Result);
}
-
- /* The result is discarded */
- return TRUE;
}
FAST486_OPCODE_HANDLER(Fast486OpcodeXchgByteModrm)
if (!Fast486ParseModRegRm(State, AddressSize, &ModRegRm))
{
/* Exception occurred */
- return FALSE;
+ return;
}
if (!Fast486ReadModrmByteOperands(State,
&SecondValue))
{
/* Exception occurred */
- return FALSE;
+ return;
}
/* Write the value from the register to the R/M */
FirstValue))
{
/* Exception occurred */
- return FALSE;
+ return;
}
/* Write the value from the R/M to the register */
- if (!Fast486WriteModrmByteOperands(State,
- &ModRegRm,
- TRUE,
- SecondValue))
- {
- /* Exception occurred */
- return FALSE;
- }
-
- return TRUE;
+ Fast486WriteModrmByteOperands(State,
+ &ModRegRm,
+ TRUE,
+ SecondValue);
}
FAST486_OPCODE_HANDLER(Fast486OpcodeXchgModrm)
if (!Fast486ParseModRegRm(State, AddressSize, &ModRegRm))
{
/* Exception occurred */
- return FALSE;
+ return;
}
/* Check the operand size */
&SecondValue))
{
/* Exception occurred */
- return FALSE;
+ return;
}
/* Write the value from the register to the R/M */
FirstValue))
{
/* Exception occurred */
- return FALSE;
+ return;
}
/* Write the value from the R/M to the register */
- if (!Fast486WriteModrmDwordOperands(State,
- &ModRegRm,
- TRUE,
- SecondValue))
- {
- /* Exception occurred */
- return FALSE;
- }
+ Fast486WriteModrmDwordOperands(State,
+ &ModRegRm,
+ TRUE,
+ SecondValue);
}
else
{
&SecondValue))
{
/* Exception occurred */
- return FALSE;
+ return;
}
/* Write the value from the register to the R/M */
FirstValue))
{
/* Exception occurred */
- return FALSE;
+ return;
}
/* Write the value from the R/M to the register */
- if (!Fast486WriteModrmWordOperands(State,
- &ModRegRm,
- TRUE,
- SecondValue))
- {
- /* Exception occurred */
- return FALSE;
- }
+ Fast486WriteModrmWordOperands(State,
+ &ModRegRm,
+ TRUE,
+ SecondValue);
}
-
- /* The result is discarded */
- return TRUE;
}
FAST486_OPCODE_HANDLER(Fast486OpcodePushEs)
{
/* Call the internal API */
- return Fast486StackPush(State, State->SegmentRegs[FAST486_REG_ES].Selector);
+ Fast486StackPush(State, State->SegmentRegs[FAST486_REG_ES].Selector);
}
FAST486_OPCODE_HANDLER(Fast486OpcodePopEs)
if (!Fast486StackPop(State, &NewSelector))
{
/* Exception occurred */
- return FALSE;
+ return;
}
/* Call the internal API */
- return Fast486LoadSegment(State, FAST486_REG_ES, LOWORD(NewSelector));
+ Fast486LoadSegment(State, FAST486_REG_ES, LOWORD(NewSelector));
}
FAST486_OPCODE_HANDLER(Fast486OpcodePushCs)
{
/* Call the internal API */
- return Fast486StackPush(State, State->SegmentRegs[FAST486_REG_CS].Selector);
+ Fast486StackPush(State, State->SegmentRegs[FAST486_REG_CS].Selector);
}
FAST486_OPCODE_HANDLER(Fast486OpcodeAdcByteModrm)
if (!Fast486ParseModRegRm(State, AddressSize, &ModRegRm))
{
/* Exception occurred */
- return FALSE;
+ return;
}
if (!Fast486ReadModrmByteOperands(State,
&SecondValue))
{
/* Exception occurred */
- return FALSE;
+ return;
}
/* Calculate the result */
State->Flags.Pf = Fast486CalculateParity(Result);
/* Write back the result */
- return Fast486WriteModrmByteOperands(State,
- &ModRegRm,
- Opcode & FAST486_OPCODE_WRITE_REG,
- Result);
+ Fast486WriteModrmByteOperands(State,
+ &ModRegRm,
+ Opcode & FAST486_OPCODE_WRITE_REG,
+ Result);
}
FAST486_OPCODE_HANDLER(Fast486OpcodeAdcModrm)
if (!Fast486ParseModRegRm(State, AddressSize, &ModRegRm))
{
/* Exception occurred */
- return FALSE;
+ return;
}
/* Check the operand size */
&SecondValue))
{
/* Exception occurred */
- return FALSE;
+ return;
}
/* Calculate the result */
State->Flags.Pf = Fast486CalculateParity(Result);
/* Write back the result */
- return Fast486WriteModrmDwordOperands(State,
- &ModRegRm,
- Opcode & FAST486_OPCODE_WRITE_REG,
- Result);
+ Fast486WriteModrmDwordOperands(State,
+ &ModRegRm,
+ Opcode & FAST486_OPCODE_WRITE_REG,
+ Result);
}
else
{
&SecondValue))
{
/* Exception occurred */
- return FALSE;
+ return;
}
/* Calculate the result */
State->Flags.Pf = Fast486CalculateParity(Result);
/* Write back the result */
- return Fast486WriteModrmWordOperands(State,
- &ModRegRm,
- Opcode & FAST486_OPCODE_WRITE_REG,
- Result);
+ Fast486WriteModrmWordOperands(State,
+ &ModRegRm,
+ Opcode & FAST486_OPCODE_WRITE_REG,
+ Result);
}
}
{
/* This opcode doesn't take any prefixes */
Fast486Exception(State, FAST486_EXCEPTION_UD);
- return FALSE;
+ return;
}
if (!Fast486FetchByte(State, &SecondValue))
{
/* Exception occurred */
- return FALSE;
+ return;
}
/* Calculate the result */
/* Write back the result */
State->GeneralRegs[FAST486_REG_EAX].LowByte = Result;
-
- return TRUE;
}
FAST486_OPCODE_HANDLER(Fast486OpcodeAdcEax)
if (!Fast486FetchDword(State, &SecondValue))
{
/* Exception occurred */
- return FALSE;
+ return;
}
/* Calculate the result */
if (!Fast486FetchWord(State, &SecondValue))
{
/* Exception occurred */
- return FALSE;
+ return;
}
/* Calculate the result */
/* Write back the result */
State->GeneralRegs[FAST486_REG_EAX].LowWord = Result;
}
-
- return TRUE;
}
FAST486_OPCODE_HANDLER(Fast486OpcodePushSs)
{
/* Call the internal API */
- return Fast486StackPush(State, State->SegmentRegs[FAST486_REG_SS].Selector);
+ Fast486StackPush(State, State->SegmentRegs[FAST486_REG_SS].Selector);
}
FAST486_OPCODE_HANDLER(Fast486OpcodePopSs)
if (!Fast486StackPop(State, &NewSelector))
{
/* Exception occurred */
- return FALSE;
+ return;
}
/* Call the internal API */
- return Fast486LoadSegment(State, FAST486_REG_SS, LOWORD(NewSelector));
+ Fast486LoadSegment(State, FAST486_REG_SS, LOWORD(NewSelector));
}
FAST486_OPCODE_HANDLER(Fast486OpcodeSbbByteModrm)
if (!Fast486ParseModRegRm(State, AddressSize, &ModRegRm))
{
/* Exception occurred */
- return FALSE;
+ return;
}
if (!Fast486ReadModrmByteOperands(State,
&SecondValue))
{
/* Exception occurred */
- return FALSE;
+ return;
}
/* Check if this is the instruction that writes to R/M */
State->Flags.Pf = Fast486CalculateParity(Result);
/* Write back the result */
- return Fast486WriteModrmByteOperands(State,
- &ModRegRm,
- Opcode & FAST486_OPCODE_WRITE_REG,
- Result);
+ Fast486WriteModrmByteOperands(State,
+ &ModRegRm,
+ Opcode & FAST486_OPCODE_WRITE_REG,
+ Result);
}
FAST486_OPCODE_HANDLER(Fast486OpcodeSbbModrm)
if (!Fast486ParseModRegRm(State, AddressSize, &ModRegRm))
{
/* Exception occurred */
- return FALSE;
+ return;
}
/* Check the operand size */
&SecondValue))
{
/* Exception occurred */
- return FALSE;
+ return;
}
/* Check if this is the instruction that writes to R/M */
State->Flags.Pf = Fast486CalculateParity(Result);
/* Write back the result */
- return Fast486WriteModrmDwordOperands(State,
- &ModRegRm,
- Opcode & FAST486_OPCODE_WRITE_REG,
- Result);
+ Fast486WriteModrmDwordOperands(State,
+ &ModRegRm,
+ Opcode & FAST486_OPCODE_WRITE_REG,
+ Result);
}
else
{
&SecondValue))
{
/* Exception occurred */
- return FALSE;
+ return;
}
/* Check if this is the instruction that writes to R/M */
State->Flags.Pf = Fast486CalculateParity(Result);
/* Write back the result */
- return Fast486WriteModrmWordOperands(State,
- &ModRegRm,
- Opcode & FAST486_OPCODE_WRITE_REG,
- Result);
+ Fast486WriteModrmWordOperands(State,
+ &ModRegRm,
+ Opcode & FAST486_OPCODE_WRITE_REG,
+ Result);
}
}
{
/* This opcode doesn't take any prefixes */
Fast486Exception(State, FAST486_EXCEPTION_UD);
- return FALSE;
+ return;
}
if (!Fast486FetchByte(State, &SecondValue))
{
/* Exception occurred */
- return FALSE;
+ return;
}
/* Calculate the result */
/* Write back the result */
State->GeneralRegs[FAST486_REG_EAX].LowByte = Result;
-
- return TRUE;
-
}
FAST486_OPCODE_HANDLER(Fast486OpcodeSbbEax)
if (!Fast486FetchDword(State, &SecondValue))
{
/* Exception occurred */
- return FALSE;
+ return;
}
/* Calculate the result */
if (!Fast486FetchWord(State, &SecondValue))
{
/* Exception occurred */
- return FALSE;
+ return;
}
/* Calculate the result */
/* Write back the result */
State->GeneralRegs[FAST486_REG_EAX].LowWord = Result;
}
-
- return TRUE;
-
}
FAST486_OPCODE_HANDLER(Fast486OpcodePushDs)
{
/* Call the internal API */
- return Fast486StackPush(State, State->SegmentRegs[FAST486_REG_DS].Selector);
+ Fast486StackPush(State, State->SegmentRegs[FAST486_REG_DS].Selector);
}
FAST486_OPCODE_HANDLER(Fast486OpcodePopDs)
if (!Fast486StackPop(State, &NewSelector))
{
/* Exception occurred */
- return FALSE;
+ return;
}
/* Call the internal API */
- return Fast486LoadSegment(State, FAST486_REG_DS, LOWORD(NewSelector));
+ Fast486LoadSegment(State, FAST486_REG_DS, LOWORD(NewSelector));
}
FAST486_OPCODE_HANDLER(Fast486OpcodeDaa)
State->Flags.Sf = (Value & SIGN_FLAG_BYTE) != 0;
State->Flags.Zf = (Value == 0);
State->Flags.Pf = Fast486CalculateParity(Value);
-
- return TRUE;
}
FAST486_OPCODE_HANDLER(Fast486OpcodeCmpSubByteModrm)
if (!Fast486ParseModRegRm(State, AddressSize, &ModRegRm))
{
/* Exception occurred */
- return FALSE;
+ return;
}
if (!Fast486ReadModrmByteOperands(State,
&SecondValue))
{
/* Exception occurred */
- return FALSE;
+ return;
}
/* Check if this is the instruction that writes to R/M */
if (!(Opcode & 0x10))
{
/* Write back the result */
- return Fast486WriteModrmByteOperands(State,
- &ModRegRm,
- Opcode & FAST486_OPCODE_WRITE_REG,
- Result);
- }
- else
- {
- /* Discard the result */
- return TRUE;
+ Fast486WriteModrmByteOperands(State,
+ &ModRegRm,
+ Opcode & FAST486_OPCODE_WRITE_REG,
+ Result);
}
}
if (!Fast486ParseModRegRm(State, AddressSize, &ModRegRm))
{
/* Exception occurred */
- return FALSE;
+ return;
}
/* Check the operand size */
&SecondValue))
{
/* Exception occurred */
- return FALSE;
+ return;
}
/* Check if this is the instruction that writes to R/M */
if (!(Opcode & 0x10))
{
/* Write back the result */
- return Fast486WriteModrmDwordOperands(State,
- &ModRegRm,
- Opcode & FAST486_OPCODE_WRITE_REG,
- Result);
- }
- else
- {
- /* Discard the result */
- return TRUE;
+ Fast486WriteModrmDwordOperands(State,
+ &ModRegRm,
+ Opcode & FAST486_OPCODE_WRITE_REG,
+ Result);
}
}
else
&SecondValue))
{
/* Exception occurred */
- return FALSE;
+ return;
}
/* Check if this is the instruction that writes to R/M */
if (!(Opcode & 0x10))
{
/* Write back the result */
- return Fast486WriteModrmWordOperands(State,
- &ModRegRm,
- Opcode & FAST486_OPCODE_WRITE_REG,
- Result);
- }
- else
- {
- /* Discard the result */
- return TRUE;
+ Fast486WriteModrmWordOperands(State,
+ &ModRegRm,
+ Opcode & FAST486_OPCODE_WRITE_REG,
+ Result);
}
}
}
{
/* This opcode doesn't take any prefixes */
Fast486Exception(State, FAST486_EXCEPTION_UD);
- return FALSE;
+ return;
}
if (!Fast486FetchByte(State, &SecondValue))
{
/* Exception occurred */
- return FALSE;
+ return;
}
/* Calculate the result */
/* Write back the result */
State->GeneralRegs[FAST486_REG_EAX].LowByte = Result;
}
-
- return TRUE;
}
FAST486_OPCODE_HANDLER(Fast486OpcodeCmpSubEax)
if (!Fast486FetchDword(State, &SecondValue))
{
/* Exception occurred */
- return FALSE;
+ return;
}
/* Calculate the result */
if (!Fast486FetchWord(State, &SecondValue))
{
/* Exception occurred */
- return FALSE;
+ return;
}
/* Calculate the result */
State->GeneralRegs[FAST486_REG_EAX].LowWord = Result;
}
}
-
- return TRUE;
}
FAST486_OPCODE_HANDLER(Fast486OpcodeDas)
State->Flags.Sf = (Value & SIGN_FLAG_BYTE) != 0;
State->Flags.Zf = (Value == 0);
State->Flags.Pf = Fast486CalculateParity(Value);
-
- return TRUE;
}
FAST486_OPCODE_HANDLER(Fast486OpcodeAaa)
/* Keep only the lowest 4 bits of AL */
State->GeneralRegs[FAST486_REG_EAX].LowByte &= 0x0F;
-
- return TRUE;
}
FAST486_OPCODE_HANDLER(Fast486OpcodeAas)
/* Keep only the lowest 4 bits of AL */
State->GeneralRegs[FAST486_REG_EAX].LowByte &= 0x0F;
-
- return TRUE;
}
FAST486_OPCODE_HANDLER(Fast486OpcodePushAll)
if (!Fast486StackPush(State, Size ? SavedEsp.Long : SavedEsp.LowWord))
{
/* Exception occurred */
- return FALSE;
+ return;
}
}
else
: State->GeneralRegs[i].LowWord))
{
/* Exception occurred */
- return FALSE;
+ return;
}
}
}
-
- return TRUE;
}
FAST486_OPCODE_HANDLER(Fast486OpcodePopAll)
if (!Fast486StackPop(State, &Value))
{
/* Exception occurred */
- return FALSE;
+ return;
}
/* Don't modify ESP */
else State->GeneralRegs[i].LowWord = LOWORD(Value);
}
}
-
- return TRUE;
}
FAST486_OPCODE_HANDLER(Fast486OpcodeBound)
if (!Fast486ParseModRegRm(State, AddressSize, &ModRegRm))
{
/* Exception occurred */
- return FALSE;
+ return;
}
if (!ModRegRm.Memory)
{
/* Invalid */
Fast486Exception(State, FAST486_EXCEPTION_UD);
- return FALSE;
+ return;
}
/* Check for the segment override */
(PULONG)&LowerBound))
{
/* Exception occurred */
- return FALSE;
+ return;
}
if (!Fast486ReadMemory(State,
sizeof(ULONG)))
{
/* Exception occurred */
- return FALSE;
+ return;
}
if ((Index < LowerBound) || (Index > UpperBound))
{
/* Out of bounds */
Fast486Exception(State, FAST486_EXCEPTION_BR);
- return FALSE;
}
}
else
(PUSHORT)&LowerBound))
{
/* Exception occurred */
- return FALSE;
+ return;
}
if (!Fast486ReadMemory(State,
sizeof(USHORT)))
{
/* Exception occurred */
- return FALSE;
+ return;
}
if ((Index < LowerBound) || (Index > UpperBound))
{
/* Out of bounds */
Fast486Exception(State, FAST486_EXCEPTION_BR);
- return FALSE;
}
}
-
- return TRUE;
}
FAST486_OPCODE_HANDLER(Fast486OpcodeArpl)
{
/* Cannot be used in real mode or with a LOCK prefix */
Fast486Exception(State, FAST486_EXCEPTION_UD);
- return FALSE;
+ return;
}
TOGGLE_ADSIZE(AddressSize);
if (!Fast486ParseModRegRm(State, AddressSize, &ModRegRm))
{
/* Exception occurred */
- return FALSE;
+ return;
}
/* Read the operands */
&SecondValue))
{
/* Exception occurred */
- return FALSE;
+ return;
}
/* Check if the RPL needs adjusting */
State->Flags.Zf = TRUE;
/* Write back the result */
- return Fast486WriteModrmWordOperands(State, &ModRegRm, FALSE, SecondValue);
+ Fast486WriteModrmWordOperands(State, &ModRegRm, FALSE, SecondValue);
}
else
{
/* Clear ZF */
State->Flags.Zf = FALSE;
- return TRUE;
}
}
if (!Fast486FetchDword(State, &Data))
{
/* Exception occurred */
- return FALSE;
+ return;
}
/* Call the internal API */
- return Fast486StackPush(State, Data);
+ Fast486StackPush(State, Data);
}
else
{
if (!Fast486FetchWord(State, (PUSHORT)&Data))
{
/* Exception occurred */
- return FALSE;
+ return;
}
/* Call the internal API */
- return Fast486StackPush(State, Data);
+ Fast486StackPush(State, Data);
}
}
if (!Fast486ParseModRegRm(State, AddressSize, &ModRegRm))
{
/* Exception occurred */
- return FALSE;
+ return;
}
if (Opcode == 0x6B)
if (!Fast486FetchByte(State, (PUCHAR)&Byte))
{
/* Exception occurred */
- return FALSE;
+ return;
}
Multiplier = (LONG)Byte;
if (!Fast486FetchDword(State, (PULONG)&Dword))
{
/* Exception occurred */
- return FALSE;
+ return;
}
Multiplier = Dword;
if (!Fast486FetchWord(State, (PUSHORT)&Word))
{
/* Exception occurred */
- return FALSE;
+ return;
}
Multiplier = (LONG)Word;
(PULONG)&Multiplicand))
{
/* Exception occurred */
- return FALSE;
+ return;
}
/* Multiply */
State->Flags.Cf = State->Flags.Of = ((Product < MINLONG) || (Product > MAXLONG));
/* Write-back the result */
- return Fast486WriteModrmDwordOperands(State,
- &ModRegRm,
- TRUE,
- (ULONG)((LONG)Product));
+ Fast486WriteModrmDwordOperands(State,
+ &ModRegRm,
+ TRUE,
+ (ULONG)((LONG)Product));
}
else
{
(PUSHORT)&Multiplicand))
{
/* Exception occurred */
- return FALSE;
+ return;
}
/* Multiply */
State->Flags.Cf = State->Flags.Of = ((Product < MINSHORT) || (Product > MAXSHORT));
/* Write-back the result */
- return Fast486WriteModrmWordOperands(State,
- &ModRegRm,
- TRUE,
- (USHORT)((SHORT)Product));
+ Fast486WriteModrmWordOperands(State,
+ &ModRegRm,
+ TRUE,
+ (USHORT)((SHORT)Product));
}
}
if (!Fast486FetchByte(State, (PUCHAR)&Data))
{
/* Exception occurred */
- return FALSE;
+ return;
}
/* Call the internal API */
- return Fast486StackPush(State, Data);
+ Fast486StackPush(State, Data);
}
FAST486_OPCODE_HANDLER(Fast486OpcodeMovByteModrm)
if (!Fast486ParseModRegRm(State, AddressSize, &ModRegRm))
{
/* Exception occurred */
- return FALSE;
+ return;
}
if (!Fast486ReadModrmByteOperands(State,
&SecondValue))
{
/* Exception occurred */
- return FALSE;
+ return;
}
if (Opcode & FAST486_OPCODE_WRITE_REG) Result = SecondValue;
else Result = FirstValue;
/* Write back the result */
- return Fast486WriteModrmByteOperands(State,
- &ModRegRm,
- Opcode & FAST486_OPCODE_WRITE_REG,
- Result);
+ Fast486WriteModrmByteOperands(State,
+ &ModRegRm,
+ Opcode & FAST486_OPCODE_WRITE_REG,
+ Result);
}
if (!Fast486ParseModRegRm(State, AddressSize, &ModRegRm))
{
/* Exception occurred */
- return FALSE;
+ return;
}
/* Check the operand size */
&SecondValue))
{
/* Exception occurred */
- return FALSE;
+ return;
}
if (Opcode & FAST486_OPCODE_WRITE_REG) Result = SecondValue;
else Result = FirstValue;
/* Write back the result */
- return Fast486WriteModrmDwordOperands(State,
- &ModRegRm,
- Opcode & FAST486_OPCODE_WRITE_REG,
- Result);
+ Fast486WriteModrmDwordOperands(State,
+ &ModRegRm,
+ Opcode & FAST486_OPCODE_WRITE_REG,
+ Result);
}
else
{
&SecondValue))
{
/* Exception occurred */
- return FALSE;
+ return;
}
if (Opcode & FAST486_OPCODE_WRITE_REG) Result = SecondValue;
else Result = FirstValue;
/* Write back the result */
- return Fast486WriteModrmWordOperands(State,
- &ModRegRm,
- Opcode & FAST486_OPCODE_WRITE_REG,
- Result);
+ Fast486WriteModrmWordOperands(State,
+ &ModRegRm,
+ Opcode & FAST486_OPCODE_WRITE_REG,
+ Result);
}
}
if (!Fast486ParseModRegRm(State, AddressSize, &ModRegRm))
{
/* Exception occurred */
- return FALSE;
+ return;
}
if (ModRegRm.Register >= FAST486_NUM_SEG_REGS)
{
/* Invalid */
Fast486Exception(State, FAST486_EXCEPTION_UD);
- return FALSE;
+ return;
}
if (OperandSize)
{
- return Fast486WriteModrmDwordOperands(State,
- &ModRegRm,
- FALSE,
- State->SegmentRegs[ModRegRm.Register].Selector);
+ Fast486WriteModrmDwordOperands(State,
+ &ModRegRm,
+ FALSE,
+ State->SegmentRegs[ModRegRm.Register].Selector);
}
else
{
- return Fast486WriteModrmWordOperands(State,
- &ModRegRm,
- FALSE,
- State->SegmentRegs[ModRegRm.Register].Selector);
+ Fast486WriteModrmWordOperands(State,
+ &ModRegRm,
+ FALSE,
+ State->SegmentRegs[ModRegRm.Register].Selector);
}
}
if (!Fast486ParseModRegRm(State, AddressSize, &ModRegRm))
{
/* Exception occurred */
- return FALSE;
+ return;
}
/* The second operand must be memory */
{
/* Invalid */
Fast486Exception(State, FAST486_EXCEPTION_UD);
- return FALSE;
+ return;
}
/* Write the address to the register */
if (OperandSize)
{
- return Fast486WriteModrmDwordOperands(State,
- &ModRegRm,
- TRUE,
- ModRegRm.MemoryAddress);
+ Fast486WriteModrmDwordOperands(State,
+ &ModRegRm,
+ TRUE,
+ ModRegRm.MemoryAddress);
}
else
{
- return Fast486WriteModrmWordOperands(State,
- &ModRegRm,
- TRUE,
- ModRegRm.MemoryAddress);
+ Fast486WriteModrmWordOperands(State,
+ &ModRegRm,
+ TRUE,
+ ModRegRm.MemoryAddress);
}
}
if (!Fast486ParseModRegRm(State, AddressSize, &ModRegRm))
{
/* Exception occurred */
- return FALSE;
+ return;
}
if ((ModRegRm.Register >= FAST486_NUM_SEG_REGS)
{
/* Invalid */
Fast486Exception(State, FAST486_EXCEPTION_UD);
- return FALSE;
+ return;
}
if (OperandSize)
if (!Fast486ReadModrmDwordOperands(State, &ModRegRm, NULL, &Selector))
{
/* Exception occurred */
- return FALSE;
+ return;
}
- return Fast486LoadSegment(State, ModRegRm.Register, LOWORD(Selector));
+ Fast486LoadSegment(State, ModRegRm.Register, LOWORD(Selector));
}
else
{
if (!Fast486ReadModrmWordOperands(State, &ModRegRm, NULL, &Selector))
{
/* Exception occurred */
- return FALSE;
+ return;
}
- return Fast486LoadSegment(State, ModRegRm.Register, Selector);
+ Fast486LoadSegment(State, ModRegRm.Register, Selector);
}
}
(State->GeneralRegs[FAST486_REG_EAX].LowByte & SIGN_FLAG_BYTE)
? 0xFF : 0x00;
}
-
- return TRUE;
}
FAST486_OPCODE_HANDLER(Fast486OpcodeCdq)
(State->GeneralRegs[FAST486_REG_EAX].LowWord & SIGN_FLAG_WORD)
? 0xFFFF : 0x0000;
}
-
- return TRUE;
}
FAST486_OPCODE_HANDLER(Fast486OpcodeCallAbs)
if (!Fast486FetchDword(State, &Offset))
{
/* Exception occurred */
- return FALSE;
+ return;
}
}
else
if (!Fast486FetchWord(State, (PUSHORT)&Offset))
{
/* Exception occurred */
- return FALSE;
+ return;
}
}
if (!Fast486FetchWord(State, &Segment))
{
/* Exception occurred */
- return FALSE;
+ return;
}
/* Push the current code segment selector */
if (!Fast486StackPush(State, State->SegmentRegs[FAST486_REG_CS].Selector))
{
/* Exception occurred */
- return FALSE;
+ return;
}
/* Push the current value of the instruction pointer */
if (!Fast486StackPush(State, State->InstPtr.Long))
{
/* Exception occurred */
- return FALSE;
+ return;
}
/* Load the new CS */
if (!Fast486LoadSegment(State, FAST486_REG_CS, Segment))
{
/* Exception occurred */
- return FALSE;
+ return;
}
/* Load new (E)IP */
if (Size) State->InstPtr.Long = Offset;
else State->InstPtr.LowWord = LOWORD(Offset);
-
- return TRUE;
}
FAST486_OPCODE_HANDLER(Fast486OpcodeWait)
{
// TODO: NOT IMPLEMENTED
UNIMPLEMENTED;
-
- return FALSE;
}
FAST486_OPCODE_HANDLER(Fast486OpcodePushFlags)
{
/* Call the VM86 monitor */
Fast486ExceptionWithErrorCode(State, FAST486_EXCEPTION_GP, 0);
- return FALSE;
+ return;
}
/* Push the flags */
- if (Size) return Fast486StackPush(State, State->Flags.Long);
- else return Fast486StackPush(State, LOWORD(State->Flags.Long));
+ if (Size) Fast486StackPush(State, State->Flags.Long);
+ else Fast486StackPush(State, LOWORD(State->Flags.Long));
}
FAST486_OPCODE_HANDLER(Fast486OpcodePopFlags)
if (!Fast486StackPop(State, &NewFlags.Long))
{
/* Exception occurred */
- return FALSE;
+ return;
}
/* Check for VM86 mode when IOPL is not 3 */
{
/* Call the VM86 monitor */
Fast486ExceptionWithErrorCode(State, FAST486_EXCEPTION_GP, 0);
- return FALSE;
+ return;
}
State->Flags.Cf = NewFlags.Cf;
if (Cpl == 0) State->Flags.Iopl = NewFlags.Iopl;
if (Cpl <= State->Flags.Iopl) State->Flags.If = NewFlags.If;
-
- return TRUE;
}
FAST486_OPCODE_HANDLER(Fast486OpcodeSahf)
/* Restore the reserved bits of FLAGS */
State->Flags.AlwaysSet = TRUE;
State->Flags.Reserved0 = State->Flags.Reserved1 = FALSE;
-
- return TRUE;
}
FAST486_OPCODE_HANDLER(Fast486OpcodeLahf)
/* Set AH to the low-order byte of FLAGS */
State->GeneralRegs[FAST486_REG_EAX].HighByte = LOBYTE(State->Flags.Long);
-
- return TRUE;
}
FAST486_OPCODE_HANDLER(Fast486OpcodeRet)
if (Opcode == 0xC2)
{
/* Fetch the number of bytes to pop after the return */
- if (!Fast486FetchWord(State, &BytesToPop)) return FALSE;
+ if (!Fast486FetchWord(State, &BytesToPop)) return;
}
/* Pop the return address */
- if (!Fast486StackPop(State, &ReturnAddress)) return FALSE;
+ if (!Fast486StackPop(State, &ReturnAddress)) return;
/* Return to the calling procedure, and if necessary, pop the parameters */
if (Size)
State->InstPtr.LowWord = LOWORD(ReturnAddress);
State->GeneralRegs[FAST486_REG_ESP].LowWord += BytesToPop;
}
-
- return TRUE;
}
FAST486_OPCODE_HANDLER(Fast486OpcodeLdsLes)
if (!Fast486ParseModRegRm(State, AddressSize, &ModRegRm))
{
/* Exception occurred */
- return FALSE;
+ return;
}
if (!ModRegRm.Memory)
if (!Fast486FetchByte(State, &BopCode))
{
/* Exception occurred */
- return FALSE;
+ return;
}
/* Call the BOP handler */
State->IntStatus = FAST486_INT_DELAYED;
}
- /* Return success */
- return TRUE;
+ return;
}
/* Invalid */
Fast486Exception(State, FAST486_EXCEPTION_UD);
- return FALSE;
+ return;
}
if (!Fast486ReadMemory(State,
OperandSize ? 6 : 4))
{
/* Exception occurred */
- return FALSE;
+ return;
}
if (OperandSize)
State->GeneralRegs[ModRegRm.Register].Long = Offset;
/* Load the segment */
- return Fast486LoadSegment(State,
- (Opcode == 0xC4)
- ? FAST486_REG_ES : FAST486_REG_DS,
- Segment);
+ Fast486LoadSegment(State,
+ (Opcode == 0xC4)
+ ? FAST486_REG_ES : FAST486_REG_DS,
+ Segment);
}
else
{
State->GeneralRegs[ModRegRm.Register].LowWord = Offset;
/* Load the segment */
- return Fast486LoadSegment(State,
- (Opcode == 0xC4)
- ? FAST486_REG_ES : FAST486_REG_DS,
- Segment);
+ Fast486LoadSegment(State,
+ (Opcode == 0xC4)
+ ? FAST486_REG_ES : FAST486_REG_DS,
+ Segment);
}
}
if (!Fast486FetchWord(State, &FrameSize))
{
/* Exception occurred */
- return FALSE;
+ return;
}
if (!Fast486FetchByte(State, &NestingLevel))
{
/* Exception occurred */
- return FALSE;
+ return;
}
/* Push EBP */
if (!Fast486StackPush(State, State->GeneralRegs[FAST486_REG_EBP].Long))
{
/* Exception occurred */
- return FALSE;
+ return;
}
/* Save ESP */
/* Reserve space for the frame */
if (Size) State->GeneralRegs[FAST486_REG_ESP].Long -= (ULONG)FrameSize;
else State->GeneralRegs[FAST486_REG_ESP].LowWord -= FrameSize;
-
- return TRUE;
}
FAST486_OPCODE_HANDLER(Fast486OpcodeLeave)
State->GeneralRegs[FAST486_REG_ESP].Long = State->GeneralRegs[FAST486_REG_EBP].Long;
/* Pop the saved base pointer from the stack */
- return Fast486StackPop(State, &State->GeneralRegs[FAST486_REG_EBP].Long);
+ Fast486StackPop(State, &State->GeneralRegs[FAST486_REG_EBP].Long);
}
else
{
if (Fast486StackPop(State, &Value))
{
State->GeneralRegs[FAST486_REG_EBP].LowWord = LOWORD(Value);
- return TRUE;
}
- else return FALSE;
}
}
if (Opcode == 0xCA)
{
/* Fetch the number of bytes to pop after the return */
- if (!Fast486FetchWord(State, &BytesToPop)) return FALSE;
+ if (!Fast486FetchWord(State, &BytesToPop)) return;
}
/* Pop the offset */
if (!Fast486StackPop(State, &Offset))
{
/* Exception occurred */
- return FALSE;
+ return;
}
/* Pop the segment */
if (!Fast486StackPop(State, &Segment))
{
/* Exception occurred */
- return FALSE;
+ return;
}
/* Load the new CS */
if (!Fast486LoadSegment(State, FAST486_REG_CS, Segment))
{
/* Exception occurred */
- return FALSE;
+ return;
}
/* Load new (E)IP, and if necessary, pop the parameters */
State->InstPtr.LowWord = LOWORD(Offset);
State->GeneralRegs[FAST486_REG_ESP].LowWord += BytesToPop;
}
-
- return TRUE;
}
FAST486_OPCODE_HANDLER(Fast486OpcodeInt)
if (!Fast486FetchByte(State, &IntNum))
{
/* Exception occurred */
- return FALSE;
+ return;
}
break;
case 0xCE: // INTO
{
/* Don't do anything if OF is cleared */
- if (!State->Flags.Of) return TRUE;
+ if (!State->Flags.Of) return;
/* Exception #OF */
IntNum = FAST486_EXCEPTION_OF;
}
/* Perform the interrupt */
- return Fast486PerformInterrupt(State, IntNum);
+ Fast486PerformInterrupt(State, IntNum);
}
FAST486_OPCODE_HANDLER(Fast486OpcodeIret)
if (!Fast486StackPop(State, &InstPtr))
{
/* Exception occurred */
- return FALSE;
+ return;
}
/* Pop CS */
if (!Fast486StackPop(State, &CodeSel))
{
/* Exception occurred */
- return FALSE;
+ return;
}
/* Pop EFLAGS */
if (!Fast486StackPop(State, &NewFlags.Long))
{
/* Exception occurred */
- return FALSE;
+ return;
}
/* Check for protected mode */
if (!Fast486LoadSegment(State, FAST486_REG_CS, CodeSel))
{
/* Exception occurred */
- return FALSE;
+ return;
}
/* Set the new flags */
{
/* Call the VM86 monitor */
Fast486ExceptionWithErrorCode(State, FAST486_EXCEPTION_GP, 0);
- return FALSE;
+ return;
}
- return TRUE;
+ return;
}
if (State->Flags.Nt)
/* Nested task return */
UNIMPLEMENTED;
- return FALSE;
+ return;
}
if (NewFlags.Vm)
ULONG Es, Ds, Fs, Gs;
/* Pop ESP, SS, ES, FS, GS */
- if (!Fast486StackPop(State, &StackPtr)) return FALSE;
- if (!Fast486StackPop(State, &StackSel)) return FALSE;
- if (!Fast486StackPop(State, &Es)) return FALSE;
- if (!Fast486StackPop(State, &Ds)) return FALSE;
- if (!Fast486StackPop(State, &Fs)) return FALSE;
- if (!Fast486StackPop(State, &Gs)) return FALSE;
+ if (!Fast486StackPop(State, &StackPtr)) return;
+ if (!Fast486StackPop(State, &StackSel)) return;
+ if (!Fast486StackPop(State, &Es)) return;
+ if (!Fast486StackPop(State, &Ds)) return;
+ if (!Fast486StackPop(State, &Fs)) return;
+ if (!Fast486StackPop(State, &Gs)) return;
/* Set the new IP */
State->InstPtr.Long = LOWORD(InstPtr);
State->Flags.AlwaysSet = State->Flags.Vm = TRUE;
/* Load the new segments */
- if (!Fast486LoadSegment(State, FAST486_REG_CS, CodeSel)) return FALSE;
- if (!Fast486LoadSegment(State, FAST486_REG_SS, StackSel)) return FALSE;
- if (!Fast486LoadSegment(State, FAST486_REG_ES, Es)) return FALSE;
- if (!Fast486LoadSegment(State, FAST486_REG_DS, Ds)) return FALSE;
- if (!Fast486LoadSegment(State, FAST486_REG_FS, Fs)) return FALSE;
- if (!Fast486LoadSegment(State, FAST486_REG_GS, Gs)) return FALSE;
+ if (!Fast486LoadSegment(State, FAST486_REG_CS, CodeSel)) return;
+ if (!Fast486LoadSegment(State, FAST486_REG_SS, StackSel)) return;
+ if (!Fast486LoadSegment(State, FAST486_REG_ES, Es)) return;
+ if (!Fast486LoadSegment(State, FAST486_REG_DS, Ds)) return;
+ if (!Fast486LoadSegment(State, FAST486_REG_FS, Fs)) return;
+ if (!Fast486LoadSegment(State, FAST486_REG_GS, Gs)) return;
- return TRUE;
+ return;
}
/* Load the new CS */
if (!Fast486LoadSegment(State, FAST486_REG_CS, CodeSel))
{
/* Exception occurred */
- return FALSE;
+ return;
}
/* Set EIP */
if (!Fast486StackPop(State, &StackPtr))
{
/* Exception */
- return FALSE;
+ return;
}
/* Pop SS */
if (!Fast486StackPop(State, &StackSel))
{
/* Exception */
- return FALSE;
+ return;
}
/* Load new SS */
if (!Fast486LoadSegment(State, FAST486_REG_SS, StackSel))
{
/* Exception */
- return FALSE;
+ return;
}
/* Set ESP */
|| !State->SegmentRegs[i].DirConf))
{
/* Load the NULL descriptor in the segment */
- if (!Fast486LoadSegment(State, i, 0)) return FALSE;
+ if (!Fast486LoadSegment(State, i, 0)) return;
}
}
}
{
/* Invalid */
Fast486ExceptionWithErrorCode(State, FAST486_EXCEPTION_GP, 0);
- return FALSE;
+ return;
}
/* Set new EIP */
if (!Fast486LoadSegment(State, FAST486_REG_CS, CodeSel))
{
/* Exception occurred */
- return FALSE;
+ return;
}
/* Set the new flags */
else State->Flags.LowWord = NewFlags.LowWord & REAL_MODE_FLAGS_MASK;
State->Flags.AlwaysSet = TRUE;
}
-
- return TRUE;
}
FAST486_OPCODE_HANDLER(Fast486OpcodeAam)
if (!Fast486FetchByte(State, &Base))
{
/* Exception occurred */
- return FALSE;
+ return;
}
/* Check if the base is zero */
{
/* Divide error */
Fast486Exception(State, FAST486_EXCEPTION_DE);
- return FALSE;
+ return;
}
/* Adjust */
State->Flags.Zf = (Value == 0);
State->Flags.Sf = ((Value & SIGN_FLAG_BYTE) != 0);
State->Flags.Pf = Fast486CalculateParity(Value);
-
- return TRUE;
}
FAST486_OPCODE_HANDLER(Fast486OpcodeAad)
if (!Fast486FetchByte(State, &Base))
{
/* Exception occurred */
- return FALSE;
+ return;
}
/* Adjust */
State->Flags.Zf = (Value == 0);
State->Flags.Sf = ((Value & SIGN_FLAG_BYTE) != 0);
State->Flags.Pf = Fast486CalculateParity(Value);
-
- return TRUE;
}
FAST486_OPCODE_HANDLER(Fast486OpcodeXlat)
sizeof(UCHAR)))
{
/* Exception occurred */
- return FALSE;
+ return;
}
/* Set AL to the result */
State->GeneralRegs[FAST486_REG_EAX].LowByte = Value;
-
- /* Return success */
- return TRUE;
}
FAST486_OPCODE_HANDLER(Fast486OpcodeLoop)
if (!Fast486FetchByte(State, (PUCHAR)&Offset))
{
/* An exception occurred */
- return FALSE;
+ return;
}
if (Condition)
if (Size) State->InstPtr.Long += Offset;
else State->InstPtr.LowWord += Offset;
}
-
- return TRUE;
}
FAST486_OPCODE_HANDLER(Fast486OpcodeJecxz)
if (!Fast486FetchByte(State, (PUCHAR)&Offset))
{
/* An exception occurred */
- return FALSE;
+ return;
}
if (Condition)
if (Size) State->InstPtr.Long += Offset;
else State->InstPtr.LowWord += Offset;
}
-
- return TRUE;
}
FAST486_OPCODE_HANDLER(Fast486OpcodeCall)
if (!Fast486FetchDword(State, (PULONG)&Offset))
{
/* An exception occurred */
- return FALSE;
+ return;
}
/* Push the current value of the instruction pointer */
if (!Fast486StackPush(State, State->InstPtr.Long))
{
/* Exception occurred */
- return FALSE;
+ return;
}
/* Move the instruction pointer */
if (!Fast486FetchWord(State, (PUSHORT)&Offset))
{
/* An exception occurred */
- return FALSE;
+ return;
}
/* Push the current value of the instruction pointer */
if (!Fast486StackPush(State, State->InstPtr.Long))
{
/* Exception occurred */
- return FALSE;
+ return;
}
/* Move the instruction pointer */
State->InstPtr.LowWord += Offset;
}
-
- return TRUE;
}
FAST486_OPCODE_HANDLER(Fast486OpcodeJmp)
if (!Fast486FetchDword(State, (PULONG)&Offset))
{
/* An exception occurred */
- return FALSE;
+ return;
}
/* Move the instruction pointer */
if (!Fast486FetchWord(State, (PUSHORT)&Offset))
{
/* An exception occurred */
- return FALSE;
+ return;
}
/* Move the instruction pointer */
/* Clear the top half of EIP */
State->InstPtr.Long &= 0xFFFF;
}
-
- return TRUE;
}
FAST486_OPCODE_HANDLER(Fast486OpcodeJmpAbs)
if (!Fast486FetchDword(State, &Offset))
{
/* Exception occurred */
- return FALSE;
+ return;
}
}
else
if (!Fast486FetchWord(State, (PUSHORT)&Offset))
{
/* Exception occurred */
- return FALSE;
+ return;
}
}
if (!Fast486FetchWord(State, &Segment))
{
/* Exception occurred */
- return FALSE;
+ return;
}
/* Load the new CS */
if (!Fast486LoadSegment(State, FAST486_REG_CS, Segment))
{
/* Exception occurred */
- return FALSE;
+ return;
}
/* Load new EIP */
State->InstPtr.Long = Offset;
-
- return TRUE;
}
FAST486_OPCODE_HANDLER(Fast486OpcodeMovAlOffset)
if (!Fast486FetchDword(State, &Offset))
{
/* Exception occurred */
- return FALSE;
+ return;
}
}
else
if (!Fast486FetchWord(State, &WordOffset))
{
/* Exception occurred */
- return FALSE;
+ return;
}
Offset = (ULONG)WordOffset;
}
/* Read from memory */
- return Fast486ReadMemory(State,
- (State->PrefixFlags & FAST486_PREFIX_SEG) ?
- State->SegmentOverride : FAST486_REG_DS,
- Offset,
- FALSE,
- &State->GeneralRegs[FAST486_REG_EAX].LowByte,
- sizeof(UCHAR));
+ Fast486ReadMemory(State,
+ (State->PrefixFlags & FAST486_PREFIX_SEG) ?
+ State->SegmentOverride : FAST486_REG_DS,
+ Offset,
+ FALSE,
+ &State->GeneralRegs[FAST486_REG_EAX].LowByte,
+ sizeof(UCHAR));
}
FAST486_OPCODE_HANDLER(Fast486OpcodeMovEaxOffset)
if (!Fast486FetchDword(State, &Offset))
{
/* Exception occurred */
- return FALSE;
+ return;
}
/* Read from memory */
if (OperandSize)
{
- return Fast486ReadMemory(State,
- (State->PrefixFlags & FAST486_PREFIX_SEG) ?
- State->SegmentOverride : FAST486_REG_DS,
- Offset,
- FALSE,
- &State->GeneralRegs[FAST486_REG_EAX].Long,
- sizeof(ULONG));
+ Fast486ReadMemory(State,
+ (State->PrefixFlags & FAST486_PREFIX_SEG) ?
+ State->SegmentOverride : FAST486_REG_DS,
+ Offset,
+ FALSE,
+ &State->GeneralRegs[FAST486_REG_EAX].Long,
+ sizeof(ULONG));
}
else
{
- return Fast486ReadMemory(State,
- (State->PrefixFlags & FAST486_PREFIX_SEG) ?
- State->SegmentOverride : FAST486_REG_DS,
- Offset,
- FALSE,
- &State->GeneralRegs[FAST486_REG_EAX].LowWord,
- sizeof(USHORT));
+ Fast486ReadMemory(State,
+ (State->PrefixFlags & FAST486_PREFIX_SEG) ?
+ State->SegmentOverride : FAST486_REG_DS,
+ Offset,
+ FALSE,
+ &State->GeneralRegs[FAST486_REG_EAX].LowWord,
+ sizeof(USHORT));
}
}
else
if (!Fast486FetchWord(State, &Offset))
{
/* Exception occurred */
- return FALSE;
+ return;
}
/* Read from memory */
if (OperandSize)
{
- return Fast486ReadMemory(State,
- (State->PrefixFlags & FAST486_PREFIX_SEG) ?
- State->SegmentOverride : FAST486_REG_DS,
- Offset,
- FALSE,
- &State->GeneralRegs[FAST486_REG_EAX].Long,
- sizeof(ULONG));
+ Fast486ReadMemory(State,
+ (State->PrefixFlags & FAST486_PREFIX_SEG) ?
+ State->SegmentOverride : FAST486_REG_DS,
+ Offset,
+ FALSE,
+ &State->GeneralRegs[FAST486_REG_EAX].Long,
+ sizeof(ULONG));
}
else
{
- return Fast486ReadMemory(State,
- (State->PrefixFlags & FAST486_PREFIX_SEG) ?
- State->SegmentOverride : FAST486_REG_DS,
- Offset,
- FALSE,
- &State->GeneralRegs[FAST486_REG_EAX].LowWord,
- sizeof(USHORT));
+ Fast486ReadMemory(State,
+ (State->PrefixFlags & FAST486_PREFIX_SEG) ?
+ State->SegmentOverride : FAST486_REG_DS,
+ Offset,
+ FALSE,
+ &State->GeneralRegs[FAST486_REG_EAX].LowWord,
+ sizeof(USHORT));
}
}
}
if (!Fast486FetchDword(State, &Offset))
{
/* Exception occurred */
- return FALSE;
+ return;
}
}
else
if (!Fast486FetchWord(State, &WordOffset))
{
/* Exception occurred */
- return FALSE;
+ return;
}
Offset = (ULONG)WordOffset;
}
/* Write to memory */
- return Fast486WriteMemory(State,
- (State->PrefixFlags & FAST486_PREFIX_SEG) ?
- State->SegmentOverride : FAST486_REG_DS,
- Offset,
- &State->GeneralRegs[FAST486_REG_EAX].LowByte,
- sizeof(UCHAR));
+ Fast486WriteMemory(State,
+ (State->PrefixFlags & FAST486_PREFIX_SEG) ?
+ State->SegmentOverride : FAST486_REG_DS,
+ Offset,
+ &State->GeneralRegs[FAST486_REG_EAX].LowByte,
+ sizeof(UCHAR));
}
FAST486_OPCODE_HANDLER(Fast486OpcodeMovOffsetEax)
if (!Fast486FetchDword(State, &Offset))
{
/* Exception occurred */
- return FALSE;
+ return;
}
/* Write to memory */
if (OperandSize)
{
- return Fast486WriteMemory(State,
- (State->PrefixFlags & FAST486_PREFIX_SEG) ?
- State->SegmentOverride : FAST486_REG_DS,
- Offset,
- &State->GeneralRegs[FAST486_REG_EAX].Long,
- sizeof(ULONG));
+ Fast486WriteMemory(State,
+ (State->PrefixFlags & FAST486_PREFIX_SEG) ?
+ State->SegmentOverride : FAST486_REG_DS,
+ Offset,
+ &State->GeneralRegs[FAST486_REG_EAX].Long,
+ sizeof(ULONG));
}
else
{
- return Fast486WriteMemory(State,
- (State->PrefixFlags & FAST486_PREFIX_SEG) ?
- State->SegmentOverride : FAST486_REG_DS,
- Offset,
- &State->GeneralRegs[FAST486_REG_EAX].LowWord,
- sizeof(USHORT));
+ Fast486WriteMemory(State,
+ (State->PrefixFlags & FAST486_PREFIX_SEG) ?
+ State->SegmentOverride : FAST486_REG_DS,
+ Offset,
+ &State->GeneralRegs[FAST486_REG_EAX].LowWord,
+ sizeof(USHORT));
}
}
else
if (!Fast486FetchWord(State, &Offset))
{
/* Exception occurred */
- return FALSE;
+ return;
}
/* Write to memory */
if (OperandSize)
{
- return Fast486WriteMemory(State,
- (State->PrefixFlags & FAST486_PREFIX_SEG) ?
- State->SegmentOverride : FAST486_REG_DS,
- Offset,
- &State->GeneralRegs[FAST486_REG_EAX].Long,
- sizeof(ULONG));
+ Fast486WriteMemory(State,
+ (State->PrefixFlags & FAST486_PREFIX_SEG) ?
+ State->SegmentOverride : FAST486_REG_DS,
+ Offset,
+ &State->GeneralRegs[FAST486_REG_EAX].Long,
+ sizeof(ULONG));
}
else
{
- return Fast486WriteMemory(State,
- (State->PrefixFlags & FAST486_PREFIX_SEG) ?
- State->SegmentOverride : FAST486_REG_DS,
- Offset,
- &State->GeneralRegs[FAST486_REG_EAX].LowWord,
- sizeof(USHORT));
+ Fast486WriteMemory(State,
+ (State->PrefixFlags & FAST486_PREFIX_SEG) ?
+ State->SegmentOverride : FAST486_REG_DS,
+ Offset,
+ &State->GeneralRegs[FAST486_REG_EAX].LowWord,
+ sizeof(USHORT));
}
}
}
/* Set all the bits of AL to CF */
State->GeneralRegs[FAST486_REG_EAX].LowByte = State->Flags.Cf ? 0xFF : 0x00;
-
- return TRUE;
}
FAST486_OPCODE_HANDLER(Fast486OpcodeMovs)
|| (!AddressSize && (State->GeneralRegs[FAST486_REG_ECX].LowWord == 0)))
{
/* Do nothing */
- return TRUE;
+ return;
}
}
DataSize))
{
/* Exception occurred */
- return FALSE;
+ return;
}
/* Write to the destination operand */
DataSize))
{
/* Exception occurred */
- return FALSE;
+ return;
}
/* Increment/decrement ESI and EDI */
}
}
}
-
- /* Return success */
- return TRUE;
}
FAST486_OPCODE_HANDLER(Fast486OpcodeCmps)
|| (!AddressSize && (State->GeneralRegs[FAST486_REG_ECX].LowWord == 0)))
{
/* Do nothing */
- return TRUE;
+ return;
}
}
DataSize))
{
/* Exception occurred */
- return FALSE;
+ return;
}
/* Read from the second source operand */
DataSize))
{
/* Exception occurred */
- return FALSE;
+ return;
}
/* Calculate the result */
State->InstPtr = State->SavedInstPtr;
}
}
-
- /* Return success */
- return TRUE;
}
FAST486_OPCODE_HANDLER(Fast486OpcodeStos)
else State->GeneralRegs[FAST486_REG_ECX].LowWord = LOWORD(Count);
/* Exception occurred */
- return FALSE;
+ return;
}
if (!State->Flags.Df)
DataSize))
{
/* Exception occurred */
- return FALSE;
+ return;
}
/* Increment/decrement EDI */
else State->GeneralRegs[FAST486_REG_EDI].LowWord -= DataSize;
}
}
-
- /* Return success */
- return TRUE;
}
FAST486_OPCODE_HANDLER(Fast486OpcodeLods)
: State->GeneralRegs[FAST486_REG_ECX].LowWord;
/* If the count is 0, do nothing */
- if (Count == 0) return TRUE;
+ if (Count == 0) return;
/* Only the last entry will be loaded */
if (!State->Flags.Df)
DataSize))
{
/* Exception occurred */
- return FALSE;
+ return;
}
/* Increment/decrement ESI */
if (!State->Flags.Df) State->GeneralRegs[FAST486_REG_ESI].LowWord += DataSize;
else State->GeneralRegs[FAST486_REG_ESI].LowWord -= DataSize;
}
-
- /* Return success */
- return TRUE;
}
FAST486_OPCODE_HANDLER(Fast486OpcodeScas)
|| (!AddressSize && (State->GeneralRegs[FAST486_REG_ECX].LowWord == 0)))
{
/* Do nothing */
- return TRUE;
+ return;
}
}
DataSize))
{
/* Exception occurred */
- return FALSE;
+ return;
}
/* Calculate the result */
State->InstPtr = State->SavedInstPtr;
}
}
-
- /* Return success */
- return TRUE;
}
FAST486_OPCODE_HANDLER(Fast486OpcodeIns)
else State->GeneralRegs[FAST486_REG_ECX].LowWord = LOWORD(Count);
/* Exception occurred */
- return FALSE;
+ return;
}
if (!State->Flags.Df)
DataSize))
{
/* Exception occurred */
- return FALSE;
+ return;
}
/* Increment/decrement EDI */
else State->GeneralRegs[FAST486_REG_EDI].LowWord -= DataSize;
}
}
-
- /* Return success */
- return TRUE;
}
FAST486_OPCODE_HANDLER(Fast486OpcodeOuts)
else State->GeneralRegs[FAST486_REG_ECX].LowWord = LOWORD(Count);
/* Exception occurred */
- return FALSE;
+ return;
}
if (State->Flags.Df)
DataSize))
{
/* Exception occurred */
- return FALSE;
+ return;
}
/* Write to the I/O port */
else State->GeneralRegs[FAST486_REG_ESI].LowWord -= DataSize;
}
}
-
- /* Return success */
- return TRUE;
}
/* EOF */
#define FAST486_NUM_OPCODE_HANDLERS 256
#define FAST486_OPCODE_WRITE_REG (1 << 1)
#define FAST486_OPCODE_HANDLER(x) \
- BOOLEAN FASTCALL x(PFAST486_STATE State, UCHAR Opcode)
+ VOID FASTCALL x(PFAST486_STATE State, UCHAR Opcode)
-typedef BOOLEAN (FASTCALL *FAST486_OPCODE_HANDLER_PROC)(PFAST486_STATE, UCHAR);
+typedef VOID (FASTCALL *FAST486_OPCODE_HANDLER_PROC)(PFAST486_STATE, UCHAR);
extern
FAST486_OPCODE_HANDLER_PROC
if (!Fast486ParseModRegRm(State, AddressSize, &ModRegRm))
{
/* Exception occurred */
- return FALSE;
+ return;
}
/* Fetch the immediate operand */
if (!Fast486FetchByte(State, &Immediate))
{
/* Exception occurred */
- return FALSE;
+ return;
}
/* Read the operands */
if (!Fast486ReadModrmByteOperands(State, &ModRegRm, NULL, &Value))
{
/* Exception occurred */
- return FALSE;
+ return;
}
/* Calculate the result */
/* Unless this is CMP, write back the result */
if (ModRegRm.Register != 7)
{
- return Fast486WriteModrmByteOperands(State, &ModRegRm, FALSE, Value);
+ Fast486WriteModrmByteOperands(State, &ModRegRm, FALSE, Value);
}
-
- return TRUE;
}
FAST486_OPCODE_HANDLER(Fast486OpcodeGroup81)
if (!Fast486ParseModRegRm(State, AddressSize, &ModRegRm))
{
/* Exception occurred */
- return FALSE;
+ return;
}
if (OperandSize)
if (!Fast486FetchDword(State, &Immediate))
{
/* Exception occurred */
- return FALSE;
+ return;
}
/* Read the operands */
if (!Fast486ReadModrmDwordOperands(State, &ModRegRm, NULL, &Value))
{
/* Exception occurred */
- return FALSE;
+ return;
}
/* Calculate the result */
/* Unless this is CMP, write back the result */
if (ModRegRm.Register != 7)
{
- return Fast486WriteModrmDwordOperands(State, &ModRegRm, FALSE, Value);
+ Fast486WriteModrmDwordOperands(State, &ModRegRm, FALSE, Value);
}
}
else
if (!Fast486FetchWord(State, &Immediate))
{
/* Exception occurred */
- return FALSE;
+ return;
}
/* Read the operands */
if (!Fast486ReadModrmWordOperands(State, &ModRegRm, NULL, &Value))
{
/* Exception occurred */
- return FALSE;
+ return;
}
/* Calculate the result */
/* Unless this is CMP, write back the result */
if (ModRegRm.Register != 7)
{
- return Fast486WriteModrmWordOperands(State, &ModRegRm, FALSE, Value);
+ Fast486WriteModrmWordOperands(State, &ModRegRm, FALSE, Value);
}
}
-
- return TRUE;
}
FAST486_OPCODE_HANDLER(Fast486OpcodeGroup83)
if (!Fast486ParseModRegRm(State, AddressSize, &ModRegRm))
{
/* Exception occurred */
- return FALSE;
+ return;
}
/* Fetch the immediate operand */
if (!Fast486FetchByte(State, (PUCHAR)&ImmByte))
{
/* Exception occurred */
- return FALSE;
+ return;
}
if (OperandSize)
if (!Fast486ReadModrmDwordOperands(State, &ModRegRm, NULL, &Value))
{
/* Exception occurred */
- return FALSE;
+ return;
}
/* Calculate the result */
/* Unless this is CMP, write back the result */
if (ModRegRm.Register != 7)
{
- return Fast486WriteModrmDwordOperands(State, &ModRegRm, FALSE, Value);
+ Fast486WriteModrmDwordOperands(State, &ModRegRm, FALSE, Value);
}
}
else
if (!Fast486ReadModrmWordOperands(State, &ModRegRm, NULL, &Value))
{
/* Exception occurred */
- return FALSE;
+ return;
}
/* Calculate the result */
/* Unless this is CMP, write back the result */
if (ModRegRm.Register != 7)
{
- return Fast486WriteModrmWordOperands(State, &ModRegRm, FALSE, Value);
+ Fast486WriteModrmWordOperands(State, &ModRegRm, FALSE, Value);
}
}
-
- return TRUE;
}
FAST486_OPCODE_HANDLER(Fast486OpcodeGroup8F)
if (!Fast486StackPop(State, &Value))
{
/* Exception occurred */
- return FALSE;
+ return;
}
if (!Fast486ParseModRegRm(State, AddressSize, &ModRegRm))
if (OperandSize) State->GeneralRegs[FAST486_REG_ESP].Long -= sizeof(ULONG);
else State->GeneralRegs[FAST486_REG_ESP].LowWord -= sizeof(USHORT);
- return FALSE;
+ return;
}
if (ModRegRm.Register != 0)
{
/* Invalid */
Fast486Exception(State, FAST486_EXCEPTION_UD);
- return FALSE;
+ return;
}
- if (OperandSize)
- {
- return Fast486WriteModrmDwordOperands(State,
- &ModRegRm,
- FALSE,
- Value);
- }
- else
- {
- return Fast486WriteModrmWordOperands(State,
- &ModRegRm,
- FALSE,
- LOWORD(Value));
- }
+ if (OperandSize) Fast486WriteModrmDwordOperands(State, &ModRegRm, FALSE, Value);
+ else Fast486WriteModrmWordOperands(State, &ModRegRm, FALSE, LOWORD(Value));
}
FAST486_OPCODE_HANDLER(Fast486OpcodeGroupC0)
if (!Fast486ParseModRegRm(State, AddressSize, &ModRegRm))
{
/* Exception occurred */
- return FALSE;
+ return;
}
/* Fetch the count */
if (!Fast486FetchByte(State, &Count))
{
/* Exception occurred */
- return FALSE;
+ return;
}
/* Read the operands */
if (!Fast486ReadModrmByteOperands(State, &ModRegRm, NULL, &Value))
{
/* Exception occurred */
- return FALSE;
+ return;
}
/* Calculate the result */
Count));
/* Write back the result */
- return Fast486WriteModrmByteOperands(State,
- &ModRegRm,
- FALSE,
- Value);
+ Fast486WriteModrmByteOperands(State, &ModRegRm, FALSE, Value);
}
FAST486_OPCODE_HANDLER(Fast486OpcodeGroupC1)
if (!Fast486ParseModRegRm(State, AddressSize, &ModRegRm))
{
/* Exception occurred */
- return FALSE;
+ return;
}
/* Fetch the count */
if (!Fast486FetchByte(State, &Count))
{
/* Exception occurred */
- return FALSE;
+ return;
}
if (OperandSize)
if (!Fast486ReadModrmDwordOperands(State, &ModRegRm, NULL, &Value))
{
/* Exception occurred */
- return FALSE;
+ return;
}
/* Calculate the result */
Count);
/* Write back the result */
- return Fast486WriteModrmDwordOperands(State, &ModRegRm, FALSE, Value);
+ Fast486WriteModrmDwordOperands(State, &ModRegRm, FALSE, Value);
}
else
{
if (!Fast486ReadModrmWordOperands(State, &ModRegRm, NULL, &Value))
{
/* Exception occurred */
- return FALSE;
+ return;
}
/* Calculate the result */
Count));
/* Write back the result */
- return Fast486WriteModrmWordOperands(State, &ModRegRm, FALSE, Value);
+ Fast486WriteModrmWordOperands(State, &ModRegRm, FALSE, Value);
}
}
if (!Fast486ParseModRegRm(State, AddressSize, &ModRegRm))
{
/* Exception occurred */
- return FALSE;
+ return;
}
if (ModRegRm.Register != 0)
{
/* Invalid */
Fast486Exception(State, FAST486_EXCEPTION_UD);
- return FALSE;
+ return;
}
/* Get the immediate operand */
if (!Fast486FetchByte(State, &Immediate))
{
/* Exception occurred */
- return FALSE;
+ return;
}
- return Fast486WriteModrmByteOperands(State,
- &ModRegRm,
- FALSE,
- Immediate);
+ Fast486WriteModrmByteOperands(State, &ModRegRm, FALSE, Immediate);
}
FAST486_OPCODE_HANDLER(Fast486OpcodeGroupC7)
if (!Fast486ParseModRegRm(State, AddressSize, &ModRegRm))
{
/* Exception occurred */
- return FALSE;
+ return;
}
if (ModRegRm.Register != 0)
{
/* Invalid */
Fast486Exception(State, FAST486_EXCEPTION_UD);
- return FALSE;
+ return;
}
if (OperandSize)
if (!Fast486FetchDword(State, &Immediate))
{
/* Exception occurred */
- return FALSE;
+ return;
}
- return Fast486WriteModrmDwordOperands(State,
- &ModRegRm,
- FALSE,
- Immediate);
+ Fast486WriteModrmDwordOperands(State, &ModRegRm, FALSE, Immediate);
}
else
{
if (!Fast486FetchWord(State, &Immediate))
{
/* Exception occurred */
- return FALSE;
+ return;
}
- return Fast486WriteModrmWordOperands(State,
- &ModRegRm,
- FALSE,
- Immediate);
+ Fast486WriteModrmWordOperands(State, &ModRegRm, FALSE, Immediate);
}
}
if (!Fast486ParseModRegRm(State, AddressSize, &ModRegRm))
{
/* Exception occurred */
- return FALSE;
+ return;
}
/* Read the operands */
if (!Fast486ReadModrmByteOperands(State, &ModRegRm, NULL, &Value))
{
/* Exception occurred */
- return FALSE;
+ return;
}
/* Calculate the result */
Value = LOBYTE(Fast486RotateOperation(State, ModRegRm.Register, Value, 8, 1));
/* Write back the result */
- return Fast486WriteModrmByteOperands(State,
- &ModRegRm,
- FALSE,
- Value);
+ Fast486WriteModrmByteOperands(State, &ModRegRm, FALSE, Value);
}
if (!Fast486ParseModRegRm(State, AddressSize, &ModRegRm))
{
/* Exception occurred */
- return FALSE;
+ return;
}
if (OperandSize)
if (!Fast486ReadModrmDwordOperands(State, &ModRegRm, NULL, &Value))
{
/* Exception occurred */
- return FALSE;
+ return;
}
/* Calculate the result */
Value = Fast486RotateOperation(State, ModRegRm.Register, Value, 32, 1);
/* Write back the result */
- return Fast486WriteModrmDwordOperands(State, &ModRegRm, FALSE, Value);
+ Fast486WriteModrmDwordOperands(State, &ModRegRm, FALSE, Value);
}
else
{
if (!Fast486ReadModrmWordOperands(State, &ModRegRm, NULL, &Value))
{
/* Exception occurred */
- return FALSE;
+ return;
}
/* Calculate the result */
Value = LOWORD(Fast486RotateOperation(State, ModRegRm.Register, Value, 16, 1));
/* Write back the result */
- return Fast486WriteModrmWordOperands(State, &ModRegRm, FALSE, Value);
+ Fast486WriteModrmWordOperands(State, &ModRegRm, FALSE, Value);
}
}
if (!Fast486ParseModRegRm(State, AddressSize, &ModRegRm))
{
/* Exception occurred */
- return FALSE;
+ return;
}
/* Read the operands */
if (!Fast486ReadModrmByteOperands(State, &ModRegRm, NULL, &Value))
{
/* Exception occurred */
- return FALSE;
+ return;
}
/* Calculate the result */
State->GeneralRegs[FAST486_REG_ECX].LowByte));
/* Write back the result */
- return Fast486WriteModrmByteOperands(State,
- &ModRegRm,
- FALSE,
- Value);
+ Fast486WriteModrmByteOperands(State, &ModRegRm, FALSE, Value);
}
FAST486_OPCODE_HANDLER(Fast486OpcodeGroupD3)
if (!Fast486ParseModRegRm(State, AddressSize, &ModRegRm))
{
/* Exception occurred */
- return FALSE;
+ return;
}
if (OperandSize)
if (!Fast486ReadModrmDwordOperands(State, &ModRegRm, NULL, &Value))
{
/* Exception occurred */
- return FALSE;
+ return;
}
/* Calculate the result */
State->GeneralRegs[FAST486_REG_ECX].LowByte);
/* Write back the result */
- return Fast486WriteModrmDwordOperands(State, &ModRegRm, FALSE, Value);
+ Fast486WriteModrmDwordOperands(State, &ModRegRm, FALSE, Value);
}
else
{
if (!Fast486ReadModrmWordOperands(State, &ModRegRm, NULL, &Value))
{
/* Exception occurred */
- return FALSE;
+ return;
}
/* Calculate the result */
State->GeneralRegs[FAST486_REG_ECX].LowByte));
/* Write back the result */
- return Fast486WriteModrmWordOperands(State, &ModRegRm, FALSE, Value);
+ Fast486WriteModrmWordOperands(State, &ModRegRm, FALSE, Value);
}
}
if (!Fast486ParseModRegRm(State, AddressSize, &ModRegRm))
{
/* Exception occurred */
- return FALSE;
+ return;
}
/* Read the operands */
if (!Fast486ReadModrmByteOperands(State, &ModRegRm, NULL, &Value))
{
/* Exception occurred */
- return FALSE;
+ return;
}
switch (ModRegRm.Register)
if (!Fast486FetchByte(State, &Immediate))
{
/* Exception occurred */
- return FALSE;
+ return;
}
/* Calculate the result */
case 2:
{
/* Write back the result */
- return Fast486WriteModrmByteOperands(State, &ModRegRm, FALSE, ~Value);
+ Fast486WriteModrmByteOperands(State, &ModRegRm, FALSE, ~Value);
+
+ break;
}
/* NEG */
State->Flags.Pf = Fast486CalculateParity(Result);
/* Write back the result */
- return Fast486WriteModrmByteOperands(State, &ModRegRm, FALSE, Result);
+ Fast486WriteModrmByteOperands(State, &ModRegRm, FALSE, Result);
+
+ break;
}
/* MUL */
{
/* Divide error */
Fast486Exception(State, FAST486_EXCEPTION_DE);
- return FALSE;
+ return;
}
Quotient = State->GeneralRegs[FAST486_REG_EAX].LowWord / Value;
{
/* Divide error */
Fast486Exception(State, FAST486_EXCEPTION_DE);
- return FALSE;
+ return;
}
Quotient = (SHORT)State->GeneralRegs[FAST486_REG_EAX].LowWord / (CHAR)Value;
break;
}
}
-
- return TRUE;
}
FAST486_OPCODE_HANDLER(Fast486OpcodeGroupF7)
if (!Fast486ParseModRegRm(State, AddressSize, &ModRegRm))
{
/* Exception occurred */
- return FALSE;
+ return;
}
/* Set the sign flag */
if (!Fast486ReadModrmDwordOperands(State, &ModRegRm, NULL, &Value))
{
/* Exception occurred */
- return FALSE;
+ return;
}
}
else
if (!Fast486ReadModrmWordOperands(State, &ModRegRm, NULL, (PUSHORT)&Value))
{
/* Exception occurred */
- return FALSE;
+ return;
}
}
if (!Fast486FetchDword(State, &Immediate))
{
/* Exception occurred */
- return FALSE;
+ return;
}
}
else
if (!Fast486FetchWord(State, (PUSHORT)&Immediate))
{
/* Exception occurred */
- return FALSE;
+ return;
}
}
if (OperandSize)
{
/* 32-bit */
- return Fast486WriteModrmDwordOperands(State, &ModRegRm, FALSE, ~Value);
+ Fast486WriteModrmDwordOperands(State, &ModRegRm, FALSE, ~Value);
}
else
{
/* 16-bit */
- return Fast486WriteModrmWordOperands(State, &ModRegRm, FALSE, LOWORD(~Value));
+ Fast486WriteModrmWordOperands(State, &ModRegRm, FALSE, LOWORD(~Value));
}
+
+ break;
}
/* NEG */
if (OperandSize)
{
/* 32-bit */
- return Fast486WriteModrmDwordOperands(State, &ModRegRm, FALSE, Result);
+ Fast486WriteModrmDwordOperands(State, &ModRegRm, FALSE, Result);
}
else
{
/* 16-bit */
- return Fast486WriteModrmWordOperands(State, &ModRegRm, FALSE, LOWORD(Result));
+ Fast486WriteModrmWordOperands(State, &ModRegRm, FALSE, LOWORD(Result));
}
+
+ break;
}
/* MUL */
{
/* Divide error */
Fast486Exception(State, FAST486_EXCEPTION_DE);
- return FALSE;
+ return;
}
if (OperandSize)
{
/* Divide error */
Fast486Exception(State, FAST486_EXCEPTION_DE);
- return FALSE;
+ return;
}
if (OperandSize)
break;
}
}
-
- return TRUE;
}
FAST486_OPCODE_HANDLER(Fast486OpcodeGroupFE)
if (!Fast486ParseModRegRm(State, AddressSize, &ModRegRm))
{
/* Exception occurred */
- return FALSE;
+ return;
}
if (ModRegRm.Register > 1)
{
/* Invalid */
Fast486Exception(State, FAST486_EXCEPTION_UD);
- return FALSE;
+ return;
}
/* Read the operands */
if (!Fast486ReadModrmByteOperands(State, &ModRegRm, NULL, &Value))
{
/* Exception occurred */
- return FALSE;
+ return;
}
if (ModRegRm.Register == 0)
State->Flags.Pf = Fast486CalculateParity(Value);
/* Write back the result */
- return Fast486WriteModrmByteOperands(State,
- &ModRegRm,
- FALSE,
- Value);
+ Fast486WriteModrmByteOperands(State, &ModRegRm, FALSE, Value);
}
FAST486_OPCODE_HANDLER(Fast486OpcodeGroupFF)
if (!Fast486ParseModRegRm(State, AddressSize, &ModRegRm))
{
/* Exception occurred */
- return FALSE;
+ return;
}
if (ModRegRm.Register == 7)
{
/* Invalid */
Fast486Exception(State, FAST486_EXCEPTION_UD);
- return FALSE;
+ return;
}
/* Read the operands */
if (!Fast486ReadModrmDwordOperands(State, &ModRegRm, NULL, &Value))
{
/* Exception occurred */
- return FALSE;
+ return;
}
if (ModRegRm.Register == 0)
if (!Fast486StackPush(State, State->InstPtr.Long))
{
/* Exception occurred */
- return FALSE;
+ return;
}
/* Set the EIP to the address */
sizeof(USHORT)))
{
/* Exception occurred */
- return FALSE;
+ return;
}
/* Push the current value of CS */
if (!Fast486StackPush(State, State->SegmentRegs[FAST486_REG_CS].Selector))
{
/* Exception occurred */
- return FALSE;
+ return;
}
/* Push the current value of EIP */
if (!Fast486StackPush(State, State->InstPtr.Long))
{
/* Exception occurred */
- return FALSE;
+ return;
}
/* Load the new code segment */
if (!Fast486LoadSegment(State, FAST486_REG_CS, Selector))
{
/* Exception occurred */
- return FALSE;
+ return;
}
/* Set the EIP to the address */
sizeof(USHORT)))
{
/* Exception occurred */
- return FALSE;
+ return;
}
/* Load the new code segment */
if (!Fast486LoadSegment(State, FAST486_REG_CS, Selector))
{
/* Exception occurred */
- return FALSE;
+ return;
}
/* Set the EIP to the address */
else if (ModRegRm.Register == 6)
{
/* Push the value on to the stack */
- return Fast486StackPush(State, Value);
+ Fast486StackPush(State, Value);
+ return;
}
if (ModRegRm.Register <= 1)
State->Flags.Pf = Fast486CalculateParity(Value);
/* Write back the result */
- return Fast486WriteModrmDwordOperands(State,
- &ModRegRm,
- FALSE,
- Value);
+ Fast486WriteModrmDwordOperands(State, &ModRegRm, FALSE, Value);
}
}
else
if (!Fast486ReadModrmWordOperands(State, &ModRegRm, NULL, &Value))
{
/* Exception occurred */
- return FALSE;
+ return;
}
if (ModRegRm.Register == 0)
if (!Fast486StackPush(State, State->InstPtr.LowWord))
{
/* Exception occurred */
- return FALSE;
+ return;
}
/* Set the IP to the address */
sizeof(USHORT)))
{
/* Exception occurred */
- return FALSE;
+ return;
}
/* Push the current value of CS */
if (!Fast486StackPush(State, State->SegmentRegs[FAST486_REG_CS].Selector))
{
/* Exception occurred */
- return FALSE;
+ return;
}
/* Push the current value of IP */
if (!Fast486StackPush(State, State->InstPtr.LowWord))
{
/* Exception occurred */
- return FALSE;
+ return;
}
/* Load the new code segment */
if (!Fast486LoadSegment(State, FAST486_REG_CS, Selector))
{
/* Exception occurred */
- return FALSE;
+ return;
}
/* Set the IP to the address */
sizeof(USHORT)))
{
/* Exception occurred */
- return FALSE;
+ return;
}
/* Load the new code segment */
if (!Fast486LoadSegment(State, FAST486_REG_CS, Selector))
{
/* Exception occurred */
- return FALSE;
+ return;
}
/* Set the IP to the address */
else if (ModRegRm.Register == 6)
{
/* Push the value on to the stack */
- return Fast486StackPush(State, Value);
+ Fast486StackPush(State, Value);
+ return;
}
else
{
/* Invalid */
Fast486Exception(State, FAST486_EXCEPTION_UD);
- return FALSE;
+ return;
}
if (ModRegRm.Register <= 1)
State->Flags.Pf = Fast486CalculateParity(Value);
/* Write back the result */
- return Fast486WriteModrmWordOperands(State,
- &ModRegRm,
- FALSE,
- Value);
+ Fast486WriteModrmWordOperands(State, &ModRegRm, FALSE, Value);
}
}
-
- return TRUE;
}
-
FAST486_OPCODE_HANDLER(Fast486ExtOpcodeGroup0F00)
{
FAST486_MOD_REG_RM ModRegRm;
if (!Fast486ParseModRegRm(State, AddressSize, &ModRegRm))
{
/* Exception occurred */
- return FALSE;
+ return;
}
/* Check which operation this is */
|| State->Flags.Vm)
{
Fast486Exception(State, FAST486_EXCEPTION_UD);
- return FALSE;
+ return;
}
- return Fast486WriteModrmWordOperands(State,
- &ModRegRm,
- FALSE,
- State->Ldtr.Selector);
+ Fast486WriteModrmWordOperands(State, &ModRegRm, FALSE, State->Ldtr.Selector);
+ break;
}
/* STR */
|| State->Flags.Vm)
{
Fast486Exception(State, FAST486_EXCEPTION_UD);
- return FALSE;
+ return;
}
- return Fast486WriteModrmWordOperands(State,
- &ModRegRm,
- FALSE,
- State->TaskReg.Selector);
+ Fast486WriteModrmWordOperands(State, &ModRegRm, FALSE, State->TaskReg.Selector);
+ break;
}
/* LLDT */
|| State->Flags.Vm)
{
Fast486Exception(State, FAST486_EXCEPTION_UD);
- return FALSE;
+ return;
}
/* This is a privileged instruction */
if (Fast486GetCurrentPrivLevel(State) != 0)
{
Fast486Exception(State, FAST486_EXCEPTION_GP);
- return FALSE;
+ return;
}
if (!Fast486ReadModrmWordOperands(State,
&Selector))
{
/* Exception occurred */
- return FALSE;
+ return;
}
/* Make sure the GDT contains the entry */
if (GET_SEGMENT_INDEX(Selector) >= (State->Gdtr.Size + 1))
{
Fast486ExceptionWithErrorCode(State, FAST486_EXCEPTION_GP, Selector);
- return FALSE;
+ return;
}
/* Read the GDT */
sizeof(GdtEntry)))
{
/* Exception occurred */
- return FALSE;
+ return;
}
if (GET_SEGMENT_INDEX(Selector) == 0)
{
RtlZeroMemory(&State->Ldtr, sizeof(State->Ldtr));
- return TRUE;
+ return;
}
if (!GdtEntry.Present)
{
Fast486ExceptionWithErrorCode(State, FAST486_EXCEPTION_NP, Selector);
- return FALSE;
+ return;
}
if (GdtEntry.Signature != FAST486_LDT_SIGNATURE)
{
/* This is not a LDT descriptor */
Fast486ExceptionWithErrorCode(State, FAST486_EXCEPTION_GP, Selector);
- return FALSE;
+ return;
}
/* Update the LDTR */
State->Ldtr.Limit = GdtEntry.Limit | (GdtEntry.LimitHigh << 16);
if (GdtEntry.Granularity) State->Ldtr.Limit <<= 12;
- return TRUE;
+ break;
}
/* LTR */
|| State->Flags.Vm)
{
Fast486Exception(State, FAST486_EXCEPTION_UD);
- return FALSE;
+ return;
}
/* This is a privileged instruction */
if (Fast486GetCurrentPrivLevel(State) != 0)
{
Fast486Exception(State, FAST486_EXCEPTION_GP);
- return FALSE;
+ return;
}
if (!Fast486ReadModrmWordOperands(State,
&Selector))
{
/* Exception occurred */
- return FALSE;
+ return;
}
/* Make sure the GDT contains the entry */
if (GET_SEGMENT_INDEX(Selector) >= (State->Gdtr.Size + 1))
{
Fast486ExceptionWithErrorCode(State, FAST486_EXCEPTION_GP, Selector);
- return FALSE;
+ return;
}
/* Read the GDT */
sizeof(GdtEntry)))
{
/* Exception occurred */
- return FALSE;
+ return;
}
if (GET_SEGMENT_INDEX(Selector) == 0)
{
Fast486Exception(State, FAST486_EXCEPTION_GP);
- return FALSE;
+ return;
}
if (!GdtEntry.Present)
{
Fast486ExceptionWithErrorCode(State, FAST486_EXCEPTION_NP, Selector);
- return FALSE;
+ return;
}
if (GdtEntry.Signature != FAST486_TSS_SIGNATURE)
{
/* This is not a TSS descriptor */
Fast486ExceptionWithErrorCode(State, FAST486_EXCEPTION_GP, Selector);
- return FALSE;
+ return;
}
/* Update the TR */
if (GdtEntry.Granularity) State->TaskReg.Limit <<= 12;
State->TaskReg.Busy = TRUE;
- return TRUE;
+ break;
}
/* VERR/VERW */
|| State->Flags.Vm)
{
Fast486Exception(State, FAST486_EXCEPTION_UD);
- return FALSE;
+ return;
}
/* This is a privileged instruction */
if (Fast486GetCurrentPrivLevel(State) != 0)
{
Fast486Exception(State, FAST486_EXCEPTION_GP);
- return FALSE;
+ return;
}
if (!Fast486ReadModrmWordOperands(State,
&Selector))
{
/* Exception occurred */
- return FALSE;
+ return;
}
if (!(Selector & SEGMENT_TABLE_INDICATOR))
{
/* Clear ZF */
State->Flags.Zf = FALSE;
- return TRUE;
+ return;
}
/* Read the GDT */
sizeof(GdtEntry)))
{
/* Exception occurred */
- return FALSE;
+ return;
}
}
else
{
/* Clear ZF */
State->Flags.Zf = FALSE;
- return TRUE;
+ return;
}
/* Read the LDT */
sizeof(GdtEntry)))
{
/* Exception occurred */
- return FALSE;
+ return;
}
}
&& (GdtEntry.Dpl <= Fast486GetCurrentPrivLevel(State)));
- return TRUE;
+ break;
}
/* Invalid */
default:
{
Fast486Exception(State, FAST486_EXCEPTION_UD);
- return FALSE;
}
}
}
if (!Fast486ParseModRegRm(State, AddressSize, &ModRegRm))
{
/* Exception occurred */
- return FALSE;
+ return;
}
/* Check for the segment override */
{
/* The second operand must be a memory location */
Fast486Exception(State, FAST486_EXCEPTION_UD);
- return FALSE;
+ return;
}
/* Fill the 6-byte table register */
*((PULONG)&TableReg[sizeof(USHORT)]) = State->Gdtr.Address;
/* Store the GDTR */
- return Fast486WriteMemory(State,
- Segment,
- ModRegRm.MemoryAddress,
- TableReg,
- sizeof(TableReg));
+ Fast486WriteMemory(State,
+ Segment,
+ ModRegRm.MemoryAddress,
+ TableReg,
+ sizeof(TableReg));
+
+ break;
}
/* SIDT */
{
/* The second operand must be a memory location */
Fast486Exception(State, FAST486_EXCEPTION_UD);
- return FALSE;
+ return;
}
/* Fill the 6-byte table register */
*((PULONG)&TableReg[sizeof(USHORT)]) = State->Idtr.Address;
/* Store the IDTR */
- return Fast486WriteMemory(State,
- Segment,
- ModRegRm.MemoryAddress,
- TableReg,
- sizeof(TableReg));
+ Fast486WriteMemory(State,
+ Segment,
+ ModRegRm.MemoryAddress,
+ TableReg,
+ sizeof(TableReg));
+
+ break;
}
/* LGDT */
if (Fast486GetCurrentPrivLevel(State) != 0)
{
Fast486Exception(State, FAST486_EXCEPTION_GP);
- return FALSE;
+ return;
}
if (!ModRegRm.Memory)
{
/* The second operand must be a memory location */
Fast486Exception(State, FAST486_EXCEPTION_UD);
- return FALSE;
+ return;
}
/* Read the new GDTR */
sizeof(TableReg)))
{
/* Exception occurred */
- return FALSE;
+ return;
}
/* Load the new GDT */
/* In 16-bit mode the highest byte is masked out */
if (!OperandSize) State->Gdtr.Address &= 0x00FFFFFF;
- return TRUE;
+ break;
}
/* LIDT */
if (Fast486GetCurrentPrivLevel(State) != 0)
{
Fast486Exception(State, FAST486_EXCEPTION_GP);
- return FALSE;
+ return;
}
if (!ModRegRm.Memory)
{
/* The second operand must be a memory location */
Fast486Exception(State, FAST486_EXCEPTION_UD);
- return FALSE;
+ return;
}
/* Read the new IDTR */
sizeof(TableReg)))
{
/* Exception occurred */
- return FALSE;
+ return;
}
/* Load the new IDT */
/* In 16-bit mode the highest byte is masked out */
if (!OperandSize) State->Idtr.Address &= 0x00FFFFFF;
- return TRUE;
+ break;
}
/* SMSW */
case 4:
{
/* Store the lower 16 bits (Machine Status Word) of CR0 */
- return Fast486WriteModrmWordOperands(State,
- &ModRegRm,
- FALSE,
- LOWORD(State->ControlRegisters[FAST486_REG_CR0]));
+ Fast486WriteModrmWordOperands(State,
+ &ModRegRm,
+ FALSE,
+ LOWORD(State->ControlRegisters[FAST486_REG_CR0]));
+
+ break;
}
/* LMSW */
if (Fast486GetCurrentPrivLevel(State) != 0)
{
Fast486Exception(State, FAST486_EXCEPTION_GP);
- return FALSE;
+ return;
}
/* Read the new Machine Status Word */
if (!Fast486ReadModrmWordOperands(State, &ModRegRm, NULL, &MachineStatusWord))
{
/* Exception occurred */
- return FALSE;
+ return;
}
/* This instruction cannot be used to return to real mode */
&& !(MachineStatusWord & FAST486_CR0_PE))
{
Fast486Exception(State, FAST486_EXCEPTION_GP);
- return FALSE;
+ return;
}
/* Set the lowest 4 bits */
State->ControlRegisters[FAST486_REG_CR0] &= 0xFFFFFFF0;
State->ControlRegisters[FAST486_REG_CR0] |= MachineStatusWord & 0x0F;
- return TRUE;
+ break;
}
/* INVLPG */
case 7:
{
UNIMPLEMENTED;
- return FALSE;
+ break;
}
/* Invalid */
default:
{
Fast486Exception(State, FAST486_EXCEPTION_UD);
- return FALSE;
}
}
}
if (!Fast486ParseModRegRm(State, AddressSize, &ModRegRm))
{
/* Exception occurred */
- return FALSE;
+ return;
}
/* All of them are reserved (UD2) */
Fast486Exception(State, FAST486_EXCEPTION_UD);
- return FALSE;
+ return;
}
FAST486_OPCODE_HANDLER(Fast486ExtOpcodeGroup0FBA)
if (!Fast486ParseModRegRm(State, AddressSize, &ModRegRm))
{
/* Exception occurred */
- return FALSE;
+ return;
}
if (ModRegRm.Register < 4)
{
/* Invalid */
Fast486Exception(State, FAST486_EXCEPTION_UD);
- return FALSE;
+ return;
}
/* Get the bit number */
if (!Fast486FetchByte(State, &BitNumber))
{
/* Exception occurred */
- return FALSE;
+ return;
}
if (ModRegRm.Memory)
if (!Fast486ReadModrmDwordOperands(State, &ModRegRm, NULL, &Value))
{
/* Exception occurred */
- return FALSE;
+ return;
}
/* Set CF to the bit value */
if (!Fast486WriteModrmDwordOperands(State, &ModRegRm, FALSE, Value))
{
/* Exception occurred */
- return FALSE;
+ return;
}
}
}
if (!Fast486ReadModrmWordOperands(State, &ModRegRm, NULL, &Value))
{
/* Exception occurred */
- return FALSE;
+ return;
}
/* Set CF to the bit value */
if (!Fast486WriteModrmWordOperands(State, &ModRegRm, FALSE, Value))
{
/* Exception occurred */
- return FALSE;
+ return;
}
}
}
-
- /* Return success */
- return TRUE;
}
/* EOF */
if (Flags & HEAP_NO_SERIALIZE)
{
/* More complex scenario */
- if (!RtlEnterHeapLock(DphRoot->HeapCritSect, TRUE))
+ if (!RtlTryEnterHeapLock(DphRoot->HeapCritSect, TRUE))
{
if (!DphRoot->nRemoteLockAcquired)
{
NTAPI
RtlEnterHeapLock(IN OUT PHEAP_LOCK Lock, IN BOOLEAN Exclusive);
+BOOLEAN
+NTAPI
+RtlTryEnterHeapLock(IN OUT PHEAP_LOCK Lock, IN BOOLEAN Exclusive);
+
NTSTATUS
NTAPI
RtlInitializeHeapLock(IN OUT PHEAP_LOCK *Lock);
PUBLIC _tcscat\r
.code\r
\r
-_tcscat:\r
+FUNC _tcscat\r
+ FPO 0, 2, 2, 2, 0, FRAME_FPO\r
push esi\r
push edi\r
mov edi, [esp + 12]\r
pop edi\r
pop esi\r
ret\r
+ENDFUNC\r
\r
END\r
/* EOF */\r
PUBLIC _tcschr\r
.code\r
\r
-_tcschr:\r
+FUNC _tcschr\r
+ FPO 0, 2, 1, 1, 0, FRAME_FPO\r
push esi\r
mov esi, [esp + 8]\r
mov edx, [esp + 12]\r
\r
pop esi\r
ret\r
+ENDFUNC\r
\r
END\r
/* EOF */\r
PUBLIC _tcscmp\r
.code\r
\r
-_tcscmp:\r
+FUNC _tcscmp\r
+ FPO 0, 2, 2, 2, 0, FRAME_FPO\r
push esi\r
push edi\r
mov esi, [esp + 12]\r
pop edi\r
pop esi\r
ret\r
+ENDFUNC\r
\r
END\r
/* EOF */\r
PUBLIC _tcslen\r
.code\r
\r
-_tcslen:\r
+FUNC _tcslen\r
+ FPO 0, 1, 1, 1, 0, FRAME_FPO\r
push edi\r
mov edi, [esp + 8]\r
xor eax, eax\r
_tcslen_end:\r
pop edi\r
ret\r
+ENDFUNC\r
\r
END\r
/* EOF */\r
PUBLIC _tcsncat\r
.code\r
\r
-_tcsncat:\r
+FUNC _tcsncat\r
+ FPO 0, 3, 2, 2, 0, FRAME_FPO\r
push esi\r
push edi\r
mov edi, [esp + 12]\r
pop esi\r
\r
ret\r
+ENDFUNC\r
\r
END\r
/* EOF */\r
PUBLIC _tcsncmp\r
.code\r
\r
-_tcsncmp:\r
+FUNC _tcsncmp\r
+ FPO 0, 3, 2, 2, 0, FRAME_FPO\r
push esi\r
push edi\r
mov esi, [esp + 12] /* s1 */\r
pop edi\r
pop esi\r
ret\r
+ENDFUNC\r
\r
END\r
/* EOF */\r
PUBLIC _tcsncpy\r
.code\r
\r
-_tcsncpy:\r
+FUNC _tcsncpy\r
+ FPO 0, 3, 2, 2, 0, FRAME_FPO\r
push esi\r
push edi\r
mov edi, [esp + 12] /* s1 */\r
pop edi\r
pop esi\r
ret\r
+ENDFUNC\r
\r
END\r
/* EOF */\r
PUBLIC _tcsnlen\r
.code\r
\r
-_tcsnlen:\r
+FUNC _tcsnlen\r
+ FPO 0, 1, 1, 1, 0, FRAME_FPO\r
push edi\r
mov edi, [esp + 8]\r
mov ecx, [esp + 12]\r
.L1:\r
pop edi\r
ret\r
+ENDFUNC\r
\r
END\r
/* EOF */\r
PUBLIC _tcsrchr\r
.code\r
\r
-_tcsrchr:\r
+FUNC _tcsrchr\r
+ FPO 0, 2, 1, 1, 0, FRAME_FPO\r
push esi\r
mov esi, [esp + 8]\r
mov edx, [esp + 12]\r
_tdec(eax)\r
pop esi\r
ret\r
+ENDFUNC\r
\r
END\r
/* EOF */\r
return STATUS_SUCCESS;
}
+BOOLEAN
+NTAPI
+RtlTryEnterHeapLock(IN OUT PHEAP_LOCK Lock, IN BOOLEAN Exclusive)
+{
+ BOOLEAN Success;
+ KeEnterCriticalRegion();
+
+ if (Exclusive)
+ Success = ExAcquireResourceExclusiveLite(&Lock->Resource, FALSE);
+ else
+ Success = ExAcquireResourceSharedLite(&Lock->Resource, FALSE);
+
+ if (!Success)
+ KeLeaveCriticalRegion();
+
+ return Success;
+}
+
NTSTATUS
NTAPI
RtlInitializeHeapLock(IN OUT PHEAP_LOCK *Lock)
#ifdef IPS_DISPLAY
DWORD LastCyclePrintout;
- DWORD Cycles = 0;
+ ULONGLONG Cycles = 0;
#endif
/* PUBLIC FUNCTIONS ***********************************************************/
{
CpuStep();
#ifdef IPS_DISPLAY
- Cycles++;
+ ++Cycles;
#endif
}
USHORT us;
struct
{
- USHORT red :5;
+ USHORT blue :5;
USHORT green :6;
+ USHORT red :5;
+ } col;
+} NICEPIXEL16_565;
+
+typedef union
+{
+ USHORT us;
+ struct
+ {
USHORT blue :5;
+ USHORT green :5;
+ USHORT red :5;
+ USHORT xxxx :1;
} col;
-} NICEPIXEL16;
+} NICEPIXEL16_555;
static __inline UCHAR
Clamp6(ULONG val)
INT DstX, DstY, SrcX, SrcY;
BLENDFUNCTION BlendFunc;
NICEPIXEL32 SrcPixel32;
- NICEPIXEL16 DstPixel16;
- UCHAR Alpha, Alpha6, Alpha5;
+ UCHAR Alpha;
EXLATEOBJ* pexlo;
EXLATEOBJ exloSrcRGB;
pexlo = CONTAINING_RECORD(ColorTranslation, EXLATEOBJ, xlo);
EXLATEOBJ_vInitialize(&exloSrcRGB, pexlo->ppalSrc, &gpalRGB, 0, 0, 0);
- SrcY = SourceRect->top;
- DstY = DestRect->top;
- while ( DstY < DestRect->bottom )
+ if (pexlo->ppalDst->flFlags & PAL_RGB16_555)
{
- SrcX = SourceRect->left;
- DstX = DestRect->left;
- while(DstX < DestRect->right)
- {
- SrcPixel32.ul = DIB_GetSource(Source, SrcX, SrcY, &exloSrcRGB.xlo);
- SrcPixel32.col.red = (SrcPixel32.col.red * BlendFunc.SourceConstantAlpha) / 255;
- SrcPixel32.col.green = (SrcPixel32.col.green * BlendFunc.SourceConstantAlpha) / 255;
- SrcPixel32.col.blue = (SrcPixel32.col.blue * BlendFunc.SourceConstantAlpha) / 255;
-
- Alpha = ((BlendFunc.AlphaFormat & AC_SRC_ALPHA) != 0) ?
- (SrcPixel32.col.alpha * BlendFunc.SourceConstantAlpha) / 255 :
- BlendFunc.SourceConstantAlpha;
-
- Alpha6 = Alpha >> 2;
- Alpha5 = Alpha >> 3;
-
- DstPixel16.us = DIB_16BPP_GetPixel(Dest, DstX, DstY) & 0xFFFF;
- /* Perform bit loss */
- SrcPixel32.col.red >>= 3;
- SrcPixel32.col.green >>= 2;
- SrcPixel32.col.blue >>= 3;
-
- /* Do the blend in the right bit depth */
- DstPixel16.col.red = Clamp5((DstPixel16.col.red * (31 - Alpha5)) / 31 + SrcPixel32.col.red);
- DstPixel16.col.green = Clamp6((DstPixel16.col.green * (63 - Alpha6)) / 63 + SrcPixel32.col.green);
- DstPixel16.col.blue = Clamp5((DstPixel16.col.blue * (31 - Alpha5)) / 31 + SrcPixel32.col.blue);
-
- DIB_16BPP_PutPixel(Dest, DstX, DstY, DstPixel16.us);
-
- DstX++;
- SrcX = SourceRect->left + ((DstX-DestRect->left)*(SourceRect->right - SourceRect->left))
- /(DestRect->right-DestRect->left);
- }
- DstY++;
- SrcY = SourceRect->top + ((DstY-DestRect->top)*(SourceRect->bottom - SourceRect->top))
- /(DestRect->bottom-DestRect->top);
+ NICEPIXEL16_555 DstPixel16;
+
+ SrcY = SourceRect->top;
+ DstY = DestRect->top;
+ while ( DstY < DestRect->bottom )
+ {
+ SrcX = SourceRect->left;
+ DstX = DestRect->left;
+ while(DstX < DestRect->right)
+ {
+ SrcPixel32.ul = DIB_GetSource(Source, SrcX, SrcY, &exloSrcRGB.xlo);
+ SrcPixel32.col.red = (SrcPixel32.col.red * BlendFunc.SourceConstantAlpha) / 255;
+ SrcPixel32.col.green = (SrcPixel32.col.green * BlendFunc.SourceConstantAlpha) / 255;
+ SrcPixel32.col.blue = (SrcPixel32.col.blue * BlendFunc.SourceConstantAlpha) / 255;
+
+ Alpha = ((BlendFunc.AlphaFormat & AC_SRC_ALPHA) != 0) ?
+ (SrcPixel32.col.alpha * BlendFunc.SourceConstantAlpha) / 255 :
+ BlendFunc.SourceConstantAlpha;
+
+ Alpha >>= 3;
+
+ DstPixel16.us = DIB_16BPP_GetPixel(Dest, DstX, DstY) & 0xFFFF;
+ /* Perform bit loss */
+ SrcPixel32.col.red >>= 3;
+ SrcPixel32.col.green >>= 3;
+ SrcPixel32.col.blue >>= 3;
+
+ /* Do the blend in the right bit depth */
+ DstPixel16.col.red = Clamp5((DstPixel16.col.red * (31 - Alpha)) / 31 + SrcPixel32.col.red);
+ DstPixel16.col.green = Clamp5((DstPixel16.col.green * (31 - Alpha)) / 31 + SrcPixel32.col.green);
+ DstPixel16.col.blue = Clamp5((DstPixel16.col.blue * (31 - Alpha)) / 31 + SrcPixel32.col.blue);
+
+ DIB_16BPP_PutPixel(Dest, DstX, DstY, DstPixel16.us);
+
+ DstX++;
+ SrcX = SourceRect->left + ((DstX-DestRect->left)*(SourceRect->right - SourceRect->left))
+ /(DestRect->right-DestRect->left);
+ }
+ DstY++;
+ SrcY = SourceRect->top + ((DstY-DestRect->top)*(SourceRect->bottom - SourceRect->top))
+ /(DestRect->bottom-DestRect->top);
+ }
+ }
+ else
+ {
+ NICEPIXEL16_565 DstPixel16;
+ UCHAR Alpha6, Alpha5;
+
+ SrcY = SourceRect->top;
+ DstY = DestRect->top;
+ while ( DstY < DestRect->bottom )
+ {
+ SrcX = SourceRect->left;
+ DstX = DestRect->left;
+ while(DstX < DestRect->right)
+ {
+ SrcPixel32.ul = DIB_GetSource(Source, SrcX, SrcY, &exloSrcRGB.xlo);
+ SrcPixel32.col.red = (SrcPixel32.col.red * BlendFunc.SourceConstantAlpha) / 255;
+ SrcPixel32.col.green = (SrcPixel32.col.green * BlendFunc.SourceConstantAlpha) / 255;
+ SrcPixel32.col.blue = (SrcPixel32.col.blue * BlendFunc.SourceConstantAlpha) / 255;
+
+ Alpha = ((BlendFunc.AlphaFormat & AC_SRC_ALPHA) != 0) ?
+ (SrcPixel32.col.alpha * BlendFunc.SourceConstantAlpha) / 255 :
+ BlendFunc.SourceConstantAlpha;
+
+ Alpha6 = Alpha >> 2;
+ Alpha5 = Alpha >> 3;
+
+ DstPixel16.us = DIB_16BPP_GetPixel(Dest, DstX, DstY) & 0xFFFF;
+ /* Perform bit loss */
+ SrcPixel32.col.red >>= 3;
+ SrcPixel32.col.green >>= 2;
+ SrcPixel32.col.blue >>= 3;
+
+ /* Do the blend in the right bit depth */
+ DstPixel16.col.red = Clamp5((DstPixel16.col.red * (31 - Alpha5)) / 31 + SrcPixel32.col.red);
+ DstPixel16.col.green = Clamp6((DstPixel16.col.green * (63 - Alpha6)) / 63 + SrcPixel32.col.green);
+ DstPixel16.col.blue = Clamp5((DstPixel16.col.blue * (31 - Alpha5)) / 31 + SrcPixel32.col.blue);
+
+ DIB_16BPP_PutPixel(Dest, DstX, DstY, DstPixel16.us);
+
+ DstX++;
+ SrcX = SourceRect->left + ((DstX-DestRect->left)*(SourceRect->right - SourceRect->left))
+ /(DestRect->right-DestRect->left);
+ }
+ DstY++;
+ SrcY = SourceRect->top + ((DstY-DestRect->top)*(SourceRect->bottom - SourceRect->top))
+ /(DestRect->bottom-DestRect->top);
+ }
}
EXLATEOBJ_vCleanup(&exloSrcRGB);
BLENDOBJ blendobj = { {AC_SRC_OVER, 0, 255, AC_SRC_ALPHA } };
EXLATEOBJ exlo;
EXLATEOBJ_vInitialize(&exlo,
- pgp->psurfColor->ppal,
+ &gpalRGB,
ppdev->ppalSurf,
- 0xFFFFFFFF,
- 0xFFFFFFFF,
- 0);
+ 0, 0, 0);
IntEngAlphaBlend(psoDest,
&pgp->psurfColor->SurfObj,
NULL,
if (psoColor)
{
- /* Color bitmap must have the same format as the dest surface */
- if (psoColor->iBitmapFormat != pso->iBitmapFormat)
+ if (fl & SPS_ALPHA)
{
- /* It's OK if we have an alpha bitmap */
- if(!(fl & SPS_ALPHA))
+ /* Always store the alpha cursor in RGB. */
+ EXLATEOBJ exloSrcRGB;
+ PEXLATEOBJ pexlo;
+
+ pexlo = CONTAINING_RECORD(pxlo, EXLATEOBJ, xlo);
+ EXLATEOBJ_vInitialize(&exloSrcRGB, pexlo->ppalSrc, &gpalRGB, 0, 0, 0);
+
+ hbmColor = EngCreateBitmap(psoColor->sizlBitmap,
+ WIDTH_BYTES_ALIGN32(sizel.cx, 32),
+ BMF_32BPP,
+ BMF_TOPDOWN | BMF_NOZEROINIT,
+ NULL);
+ psurfColor = SURFACE_ShareLockSurface(hbmColor);
+ if (!psurfColor) goto failure;
+
+ /* Now copy the given bitmap. */
+ rectl.bottom = psoColor->sizlBitmap.cy;
+ IntEngCopyBits(&psurfColor->SurfObj,
+ psoColor,
+ NULL,
+ &exloSrcRGB.xlo,
+ &rectl,
+ (POINTL*)&rectl);
+
+ EXLATEOBJ_vCleanup(&exloSrcRGB);
+ }
+ else
+ {
+ /* Color bitmap must have the same format as the dest surface */
+ if (psoColor->iBitmapFormat != pso->iBitmapFormat)
{
DPRINT1("Screen surface and cursor color bitmap format don't match!.\n");
goto failure;
}
- }
- /* Create a bitmap to copy the color bitmap to */
- hbmColor = EngCreateBitmap(psoColor->sizlBitmap,
- lDelta,
- pso->iBitmapFormat,
- BMF_TOPDOWN | BMF_NOZEROINIT,
- NULL);
- psurfColor = SURFACE_ShareLockSurface(hbmColor);
- if (!psurfColor) goto failure;
+ /* Create a bitmap to copy the color bitmap to */
+ hbmColor = EngCreateBitmap(psoColor->sizlBitmap,
+ lDelta,
+ pso->iBitmapFormat,
+ BMF_TOPDOWN | BMF_NOZEROINIT,
+ NULL);
+ psurfColor = SURFACE_ShareLockSurface(hbmColor);
+ if (!psurfColor) goto failure;
+
+ /* Now copy the given bitmap. */
+ rectl.bottom = psoColor->sizlBitmap.cy;
+ IntEngCopyBits(&psurfColor->SurfObj,
+ psoColor,
+ NULL,
+ pxlo,
+ &rectl,
+ (POINTL*)&rectl);
+ }
- /* Now copy the given bitmap */
- rectl.bottom = psoColor->sizlBitmap.cy;
- IntEngCopyBits(&psurfColor->SurfObj,
- psoColor,
- NULL,
- pxlo,
- &rectl,
- (POINTL*)&rectl);
}
/* Create a mask surface */
EXLATEOBJ exlo;
PPALETTE ppal;
+ lDelta = WIDTH_BYTES_ALIGN32(sizel.cx, BitsPerFormat(pso->iBitmapFormat));
+
/* Create a bitmap for the mask */
hbmMask = EngCreateBitmap(psoMask->sizlBitmap,
lDelta,
BOOL Enabled;
SIZEL Size;
POINTL HotSpot;
- XLATEOBJ *XlateObject;
SURFACE *psurfColor;
SURFACE *psurfMask;
SURFACE *psurfSave;
GdiSetLastError(ERROR_INVALID_PARAMETER);
return 0;
}
+
+ /* Use the header from the data */
+ Header = &Data->bmiHeader;
}
/* Header is required */
return 0;
}
+ /* If some Bits are given, only DIB_PAL_COLORS and DIB_RGB_COLORS are valid */
+ if (Bits && (ColorUse > DIB_PAL_COLORS))
+ {
+ GdiSetLastError(ERROR_INVALID_PARAMETER);
+ return 0;
+ }
+
/* Negative width is not allowed */
if (width < 0)
return 0;
IntCreateCompatibleBitmap(
PDC Dc,
INT Width,
- INT Height)
+ INT Height,
+ UINT Planes,
+ UINT Bpp)
{
HBITMAP Bmp = NULL;
PPALETTE ppal;
Bmp = GreCreateBitmap(abs(Width),
abs(Height),
- 1,
- Dc->ppdev->gdiinfo.cBitsPixel,
+ Planes ? Planes : 1,
+ Bpp ? Bpp : Dc->ppdev->gdiinfo.cBitsPixel,
NULL);
psurf = SURFACE_ShareLockSurface(Bmp);
ASSERT(psurf);
Bmp = GreCreateBitmap(abs(Width),
abs(Height),
- 1,
- dibs.dsBm.bmBitsPixel,
+ Planes ? Planes : 1,
+ Bpp ? Bpp : dibs.dsBm.bmBitsPixel,
NULL);
psurfBmp = SURFACE_ShareLockSurface(Bmp);
ASSERT(psurfBmp);
bi->bmiHeader.biSize = sizeof(bi->bmiHeader);
bi->bmiHeader.biWidth = Width;
bi->bmiHeader.biHeight = Height;
- bi->bmiHeader.biPlanes = dibs.dsBmih.biPlanes;
- bi->bmiHeader.biBitCount = dibs.dsBmih.biBitCount;
+ bi->bmiHeader.biPlanes = Planes ? Planes : dibs.dsBmih.biPlanes;
+ bi->bmiHeader.biBitCount = Bpp ? Bpp : dibs.dsBmih.biBitCount;
bi->bmiHeader.biCompression = dibs.dsBmih.biCompression;
bi->bmiHeader.biSizeImage = 0;
bi->bmiHeader.biXPelsPerMeter = dibs.dsBmih.biXPelsPerMeter;
return NULL;
}
- Bmp = IntCreateCompatibleBitmap(Dc, Width, Height);
+ Bmp = IntCreateCompatibleBitmap(Dc, Width, Height, 0, 0);
DC_UnlockDc(Dc);
return Bmp;
PDC Dc,
INT width,
INT height,
+ UINT planes,
UINT bpp,
+ ULONG compression,
DWORD init,
LPBYTE bits,
PBITMAPINFO data,
{
HBITMAP handle;
BOOL fColor;
+ ULONG BmpFormat = 0;
+
+ if (planes && bpp)
+ BmpFormat = BitmapFormat(planes * bpp, compression);
// Check if we should create a monochrome or color bitmap. We create a monochrome bitmap only if it has exactly 2
// colors, which are black followed by white, nothing else. In all other cases, we create a color bitmap.
- if (bpp != 1) fColor = TRUE;
- else if ((coloruse != DIB_RGB_COLORS) || (init != CBM_INIT) || !data) fColor = FALSE;
+ if (BmpFormat != BMF_1BPP) fColor = TRUE;
+ else if ((coloruse > DIB_RGB_COLORS) || ((init & CBM_INIT) == 0) || !data) fColor = FALSE;
else
{
const RGBQUAD *rgb = (RGBQUAD*)((PBYTE)data + data->bmiHeader.biSize);
// Now create the bitmap
if (fColor)
{
- handle = IntCreateCompatibleBitmap(Dc, width, height);
+ if (init & CBM_CREATDIB)
+ {
+ PSURFACE Surface;
+ PPALETTE Palette;
+
+ /* Undocumented flag which creates a DDB of the format specified by the bitmap info. */
+ handle = IntCreateCompatibleBitmap(Dc, width, height, planes, bpp);
+ if (!handle)
+ return NULL;
+ /* The palette must also match the given data */
+ Surface = SURFACE_ShareLockSurface(handle);
+ ASSERT(Surface);
+ Palette = CreateDIBPalette(data, Dc, coloruse);
+ ASSERT(Palette);
+ SURFACE_vSetPalette(Surface, Palette);
+
+ PALETTE_ShareUnlockPalette(Palette);
+ SURFACE_ShareUnlockSurface(Surface);
+ }
+ else
+ {
+ /* Create a regular compatible bitmap, in the same format as the device */
+ handle = IntCreateCompatibleBitmap(Dc, width, height, 0, 0);
+ }
}
else
{
if (height < 0)
height = -height;
- if (NULL != handle && CBM_INIT == init)
+ if ((NULL != handle) && (CBM_INIT & init))
{
IntSetDIBits(Dc, handle, 0, height, bits, data, coloruse);
}
PBYTE safeBits = NULL;
HBITMAP hbmResult = NULL;
- if(pjInit && (fInit == CBM_INIT))
+ if(pjInit && (fInit & CBM_INIT))
{
if (cjMaxBits == 0) return NULL;
safeBits = ExAllocatePoolWithTag(PagedPool, cjMaxBits, TAG_DIB);
_SEH2_TRY
{
if(pbmi) ProbeForRead(pbmi, cjMaxInitInfo, 1);
- if(pjInit && (fInit == CBM_INIT))
+ if(pjInit && (fInit & CBM_INIT))
{
ProbeForRead(pjInit, cjMaxBits, 1);
RtlCopyMemory(safeBits, pjInit, cjMaxBits);
{
PDC Dc;
HBITMAP Bmp;
- WORD bpp;
+ USHORT bpp, planes;
+ DWORD compression;
HDC hdcDest;
if (!hDc) /* 1bpp monochrome bitmap */
/* It's OK to set bpp=0 here, as IntCreateDIBitmap will create a compatible Bitmap
* if bpp != 1 and ignore the real value that was passed */
if (pbmi)
- bpp = pbmi->bmiHeader.biBitCount;
+ {
+ if (pbmi->bmiHeader.biSize == sizeof(BITMAPCOREHEADER))
+ {
+ BITMAPCOREHEADER* CoreHeader = (BITMAPCOREHEADER*)&pbmi->bmiHeader;
+ bpp = CoreHeader->bcBitCount;
+ planes = CoreHeader->bcPlanes ? CoreHeader->bcPlanes : 1;
+ compression = BI_RGB;
+ }
+ else
+ {
+ bpp = pbmi->bmiHeader.biBitCount;
+ planes = pbmi->bmiHeader.biPlanes ? pbmi->bmiHeader.biPlanes : 1;
+ compression = pbmi->bmiHeader.biCompression;
+ }
+ }
else
+ {
bpp = 0;
- Bmp = IntCreateDIBitmap(Dc, cx, cy, bpp, fInit, pjInit, pbmi, iUsage);
+ planes = 0;
+ compression = 0;
+ }
+ Bmp = IntCreateDIBitmap(Dc, cx, cy, bpp, planes, compression, fInit, pjInit, pbmi, iUsage);
DC_UnlockDc(Dc);
if(!hDc)
HBITMAP
FASTCALL
-IntCreateCompatibleBitmap(PDC Dc,
- INT Width,
- INT Height);
+IntCreateCompatibleBitmap(
+ _In_ PDC Dc,
+ _In_ INT Width,
+ _In_ INT Height,
+ _In_ UINT Bpp,
+ _In_ UINT Planes);
WORD APIENTRY IntGdiSetHookFlags(HDC hDC, WORD Flags);
// Fixes running the static test then run class test issue.
// Some applications do not use UnregisterClass before exiting.
- // Keep from reusing the same atom with case insensitive
+ // Keep from reusing the same atom with case insensitive
// comparisons, remove registration of the atom if not zeroed.
if (Class->atomClassName)
IntDeregisterClassAtom(Class->atomClassName);
// hIconSm, A handle to a small icon that is associated with the window class.
// If this member is NULL, the system searches the icon resource specified by
// the hIcon member for an icon of the appropriate size to use as the small icon.
- //
+ //
case GCLP_HICON:
#ifdef NEW_CURSORICON
{
UNICODE_STRING CapturedName = {0}, CapturedMenuName = {0};
RTL_ATOM Ret = (RTL_ATOM)0;
PPROCESSINFO ppi = GetW32ProcessInfo();
+ BOOL Exception = FALSE;
if (Flags & ~(CSF_ANSIPROC))
{
}
TRACE("NtUserRegisterClassExWOW MnuN %wZ\n",&CapturedMenuName);
+ }
+ _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
+ {
+ ERR("NtUserRegisterClassExWOW Exception Error!\n");
+ SetLastNtError(_SEH2_GetExceptionCode());
+ Exception = TRUE;
+ }
+ _SEH2_END;
+ if (!Exception)
+ {
/* Register the class */
Ret = UserRegisterClass(&CapturedClassInfo,
&CapturedName,
fnID,
Flags);
}
- _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
- {
- ERR("NtUserRegisterClassExWOW Exception Error!\n");
- SetLastNtError(_SEH2_GetExceptionCode());
- }
- _SEH2_END;
-/*
+
if (!Ret)
{
- ERR("NtUserRegisterClassExWOW Null Return!\n");
+ TRACE("NtUserRegisterClassExWOW Null Return!\n");
}
- */
+
UserLeave();
return Ret;
UINT i;
for(i = 0; i < AniCurIcon->cpcur; i++)
+ {
+ UserDereferenceObject(AniCurIcon->aspcur[i]);
IntDestroyCurIconObject(AniCurIcon->aspcur[i]);
+ }
ExFreePoolWithTag(AniCurIcon->aspcur, USERTAG_CURSOR);
}
for(i = 0; i < numFrames; i++)
{
if(AniCurIcon->aspcur[i])
+ {
+ UserDereferenceObject(AniCurIcon->aspcur[i]);
IntDestroyCurIconObject(AniCurIcon->aspcur[i]);
+ }
}
AniCurIcon->cicur = 0;
AniCurIcon->cpcur = 0;
lpmi->cyMenu = Menu->cyMenu;
lpmi->spwndNotify = Menu->spwndNotify;
lpmi->cxTextAlign = Menu->cxTextAlign;
- lpmi->iTop = Menu->iMaxTop;
+ lpmi->iTop = Menu->iTop;
lpmi->iMaxTop = Menu->iMaxTop;
lpmi->dwArrowsOn = Menu->dwArrowsOn;
*
* Create the alpha bitmap for a 32-bpp icon that has an alpha channel.
*/
-static HBITMAP create_alpha_bitmap(
- _In_ HBITMAP color,
- _In_opt_ const BITMAPINFO *src_info,
- _In_opt_ const void *color_bits )
+static
+HBITMAP
+create_alpha_bitmap(
+ _In_opt_ HBITMAP color,
+ _In_opt_ BITMAPINFO *src_info,
+ _In_opt_ const void *color_bits,
+ _In_ LONG width,
+ _In_ LONG height)
{
HBITMAP alpha = NULL, hbmpOld;
- BITMAPINFO *info = NULL;
HDC hdc = NULL, hdcScreen;
- void *bits = NULL;
unsigned char *ptr;
- int i;
- LONG width, height;
- BITMAP bm;
-
- if (!GetObjectW( color, sizeof(bm), &bm ))
- return NULL;
- if (bm.bmBitsPixel != 32)
- return NULL;
+ void *bits = NULL;
+ size_t size;
hdcScreen = CreateDCW(DISPLAYW, NULL, NULL, NULL);
- if(!hdcScreen)
+ if (!hdcScreen)
return NULL;
- if(GetDeviceCaps(hdcScreen, BITSPIXEL) != 32)
- goto done;
hdc = CreateCompatibleDC(hdcScreen);
- if(!hdc)
- goto done;
-
- if(src_info)
+ if (!hdc)
{
- WORD bpp;
- DWORD compr;
- int size;
-
- if(!bmi_has_alpha(src_info, color_bits))
- goto done;
-
- if(!DIB_GetBitmapInfo(&src_info->bmiHeader, &width, &height, &bpp, &compr))
+ DeleteDC(hdcScreen);
+ return NULL;
+ }
+
+ if (color)
+ {
+ BITMAP bm;
+ BITMAPINFO *info = NULL;
+
+ TRACE("Creating alpha bitmap from existing bitmap.\n");
+
+ if (!GetObjectW( color, sizeof(bm), &bm ))
goto done;
- if(bpp != 32)
+ if (bm.bmBitsPixel != 32)
goto done;
- size = get_dib_image_size(width, height, bpp);
- bits = HeapAlloc(GetProcessHeap(), 0, size);
- if(!bits)
- goto done;
- CopyMemory(bits, color_bits, size);
- }
- else
- {
+ size = get_dib_image_size(bm.bmWidth, bm.bmHeight, 32);
+
info = HeapAlloc(GetProcessHeap(), 0, FIELD_OFFSET(BITMAPINFO, bmiColors[256]));
if(!info)
goto done;
info->bmiHeader.biPlanes = 1;
info->bmiHeader.biBitCount = 32;
info->bmiHeader.biCompression = BI_RGB;
- info->bmiHeader.biSizeImage = bm.bmWidth * bm.bmHeight * 4;
+ info->bmiHeader.biSizeImage = size;
info->bmiHeader.biXPelsPerMeter = 0;
info->bmiHeader.biYPelsPerMeter = 0;
info->bmiHeader.biClrUsed = 0;
info->bmiHeader.biClrImportant = 0;
- bits = HeapAlloc(GetProcessHeap(), 0, info->bmiHeader.biSizeImage);
+ bits = HeapAlloc(GetProcessHeap(), 0, size);
if(!bits)
+ {
+ HeapFree(GetProcessHeap(), 0, info);
goto done;
+ }
if(!GetDIBits( hdc, color, 0, bm.bmHeight, bits, info, DIB_RGB_COLORS ))
+ {
+ HeapFree(GetProcessHeap(), 0, info);
goto done;
+ }
if (!bmi_has_alpha( info, bits ))
+ {
+ HeapFree(GetProcessHeap(), 0, info);
goto done;
- width = bm.bmWidth;
- height = bm.bmHeight;
- }
+ }
- /* pre-multiply by alpha */
- for (i = 0, ptr = bits; i < width * height; i++, ptr += 4)
- {
- unsigned int alpha = ptr[3];
- ptr[0] = ptr[0] * alpha / 255;
- ptr[1] = ptr[1] * alpha / 255;
- ptr[2] = ptr[2] * alpha / 255;
+ /* pre-multiply by alpha */
+ for (ptr = bits; ptr < ((BYTE*)bits + size); ptr += 4)
+ {
+ unsigned int alpha = ptr[3];
+ ptr[0] = (ptr[0] * alpha) / 255;
+ ptr[1] = (ptr[1] * alpha) / 255;
+ ptr[2] = (ptr[2] * alpha) / 255;
+ }
+
+ /* Directly create a 32-bits DDB (thanks to undocumented CreateDIBitmap flag). */
+ alpha = CreateDIBitmap(hdc, NULL, CBM_INIT | 2, bits, info, DIB_RGB_COLORS);
+
+ HeapFree(GetProcessHeap(), 0, info);
}
-
- /* Create the bitmap */
- alpha = CreateCompatibleBitmap(hdcScreen, bm.bmWidth, bm.bmHeight);
- if(!alpha)
- goto done;
- hbmpOld = SelectObject(hdc, alpha);
- if(!hbmpOld)
- goto done;
- if(!StretchDIBits( hdc, 0, 0, bm.bmWidth, bm.bmHeight,
- 0, 0, width, height,
- bits, src_info ? src_info : info, DIB_RGB_COLORS, SRCCOPY ))
+ else
{
- SelectObject(hdc, hbmpOld);
- hbmpOld = NULL;
- DeleteObject(alpha);
- alpha = NULL;
+ WORD bpp;
+ DWORD compr;
+ LONG orig_width, orig_height;
+
+ TRACE("Creating alpha bitmap from bitmap info.\n");
+
+ if(!bmi_has_alpha(src_info, color_bits))
+ goto done;
+
+ if(!DIB_GetBitmapInfo(&src_info->bmiHeader, &orig_width, &orig_height, &bpp, &compr))
+ goto done;
+ if(bpp != 32)
+ goto done;
+
+ size = get_dib_image_size(orig_width, orig_height, bpp);
+ bits = HeapAlloc(GetProcessHeap(), 0, size);
+ if(!bits)
+ goto done;
+ CopyMemory(bits, color_bits, size);
+ /* pre-multiply by alpha */
+ for (ptr = bits; ptr < ((BYTE*)bits + size); ptr += 4)
+ {
+ unsigned int alpha = ptr[3];
+ ptr[0] = (ptr[0] * alpha) / 255;
+ ptr[1] = (ptr[1] * alpha) / 255;
+ ptr[2] = (ptr[2] * alpha) / 255;
+ }
+
+ /* Create the bitmap. Set the bitmap info to have the right width and height */
+ if(src_info->bmiHeader.biSize == sizeof(BITMAPCOREHEADER))
+ {
+ ((BITMAPCOREHEADER*)&src_info->bmiHeader)->bcWidth = width;
+ ((BITMAPCOREHEADER*)&src_info->bmiHeader)->bcHeight = height;
+ }
+ else
+ {
+ src_info->bmiHeader.biWidth = width;
+ src_info->bmiHeader.biHeight = height;
+ }
+ /* Directly create a 32-bits DDB (thanks to undocumented CreateDIBitmap flag). */
+ alpha = CreateDIBitmap(hdcScreen, NULL, 2, NULL, src_info, DIB_RGB_COLORS);
+ /* Restore values */
+ if(src_info->bmiHeader.biSize == sizeof(BITMAPCOREHEADER))
+ {
+ ((BITMAPCOREHEADER*)&src_info->bmiHeader)->bcWidth = orig_width;
+ ((BITMAPCOREHEADER*)&src_info->bmiHeader)->bcHeight = orig_height;
+ }
+ else
+ {
+ src_info->bmiHeader.biWidth = orig_width;
+ src_info->bmiHeader.biHeight = orig_height;
+ }
+ if(!alpha)
+ goto done;
+ hbmpOld = SelectObject(hdc, alpha);
+ if(!hbmpOld)
+ {
+ DeleteObject(alpha);
+ alpha = NULL;
+ goto done;
+ }
+ if(!StretchDIBits( hdc, 0, 0, width, height,
+ 0, 0, orig_width, orig_height,
+ bits, src_info, DIB_RGB_COLORS, SRCCOPY ))
+ {
+ SelectObject(hdc, hbmpOld);
+ hbmpOld = NULL;
+ DeleteObject(alpha);
+ alpha = NULL;
+ }
+ else
+ {
+ SelectObject(hdc, hbmpOld);
+ }
}
- SelectObject(hdc, hbmpOld);
done:
DeleteDC(hdcScreen);
- if(hdc) DeleteDC( hdc );
- if(info) HeapFree( GetProcessHeap(), 0, info );
+ DeleteDC( hdc );
if(bits) HeapFree(GetProcessHeap(), 0, bits);
TRACE("Returning 0x%08x.\n", alpha);
/* Let's assume there's always one plane */
fakeEntry->wPlanes = 1;
/* We must get the bitcount from the BITMAPINFOHEADER itself */
- fakeEntry->wBitCount = ((BITMAPINFOHEADER *)((char *)dir + entry->dwDIBOffset))->biBitCount;
+ if (((BITMAPINFOHEADER *)((char *)dir + entry->dwDIBOffset))->biSize == sizeof(BITMAPCOREHEADER))
+ fakeEntry->wBitCount = ((BITMAPCOREHEADER *)((char *)dir + entry->dwDIBOffset))->bcBitCount;
+ else
+ fakeEntry->wBitCount = ((BITMAPINFOHEADER *)((char *)dir + entry->dwDIBOffset))->biBitCount;
fakeEntry->dwBytesInRes = entry->dwDIBSize;
fakeEntry->wResId = i + 1;
}
pvColor, pbmiCopy, DIB_RGB_COLORS, SRCCOPY))
goto done;
pdata->bpp = GetDeviceCaps(hdcScreen, BITSPIXEL);
- if(pdata->bpp == 32)
- pdata->hbmAlpha = create_alpha_bitmap(pdata->hbmColor, pbmiCopy, pvColor);
+ pdata->hbmAlpha = create_alpha_bitmap(NULL, pbmiCopy, pvColor, pdata->cx, pdata->cy);
/* Now convert the info to monochrome for the mask bits */
if (pbmiCopy->bmiHeader.biSize != sizeof(BITMAPCOREHEADER))
pCursorData->cx = bm.bmWidth;
pCursorData->cy = bm.bmHeight;
if(pCursorData->bpp == 32)
- pCursorData->hbmAlpha = create_alpha_bitmap(pCursorData->hbmColor, NULL, NULL);
+ pCursorData->hbmAlpha = create_alpha_bitmap(pCursorData->hbmColor, NULL, NULL, 0, 0);
}
else
{
#define MENU_COL_SPACE 4
/* top and bottom margins for popup menus */
-#define MENU_TOP_MARGIN 3
+#define MENU_TOP_MARGIN 2 //3
#define MENU_BOTTOM_MARGIN 2
#define MENU_TYPE_MASK (MF_STRING | MF_BITMAP | MF_OWNERDRAW | MF_SEPARATOR)
MenuInfo->cyMenu = pMenu->cyMenu;
MenuInfo->spwndNotify = pMenu->spwndNotify;
MenuInfo->cxTextAlign = pMenu->cxTextAlign;
- MenuInfo->iTop = pMenu->iMaxTop;
+ MenuInfo->iTop = pMenu->iTop;
MenuInfo->iMaxTop = pMenu->iMaxTop;
MenuInfo->dwArrowsOn = pMenu->dwArrowsOn;
orgX = maxX;
//if( lpitem.fType & (MF_MENUBREAK | MF_MENUBARBREAK))
// orgX += MENU_COL_SPACE;
- orgY = 2;//MENU_TOP_MARGIN;
+ orgY = MENU_TOP_MARGIN;
maxTab = maxTabWidth = 0;
/* Parse items until column break or end of menu */