Share to: share facebook share twitter share wa share telegram print page

Windows Native API

The Native API is a lightweight application programming interface (API) used by Windows NT's kernel and user mode applications. This API is used in the early stages of Windows NT startup process, when other components and APIs are still unavailable. Therefore, a few Windows components, such as the Client/Server Runtime Subsystem (CSRSS), are implemented using the Native API. The Native API is also used by subroutines such as those in kernel32.dll that implement the Windows API, the API based on which most of the Windows components are created.

Most of the Native API calls are implemented in ntoskrnl.exe and are exposed to user mode by ntdll.dll. The entry point of ntdll.dll is LdrInitializeThunk. Native API calls are handled by the kernel via the System Service Descriptor Table (SSDT).

Function groups

The Native API comprises many functions. They include C runtime functions that are needed for a very basic C runtime execution, such as strlen(), sprintf(), memcpy() and floor(). Other common procedures like malloc(), printf(), scanf() are missing (the first because it does not specify a heap to allocate memory from and the second and third because they use the console, accessed only via KERNEL32.DLL). The vast majority of other Native API routines, by convention, have a 2 or 3 letter prefix, which is:

  • Nt or Zw are system calls declared in ntdll.dll and ntoskrnl.exe. When called from ntdll.dll in user mode, these groups are almost exactly the same; they execute an interrupt into kernel mode and call the equivalent function in ntoskrnl.exe via the SSDT. When calling the functions directly in ntoskrnl.exe (only possible in kernel mode), the Zw variants ensure kernel mode, whereas the Nt variants do not.[1] The Zw prefix does not stand for anything.[2]
  • Rtl is the second largest group of ntdll calls. These comprise the (extended) C Run-Time Library, which includes many utility functions that can be used by native applications, yet don't directly involve kernel support.
  • Csr are client-server functions that are used to communicate with the Win32 subsystem process, csrss.exe (csrss stands for client/server runtime sub-system).
  • Dbg are debugging functions such as a software breakpoint.
  • Ki are upcalls from kernel mode for events like APC dispatching.
  • Ldr are loader functions for PE file handling and starting of new processes.
  • Nls for National Language Support (similar to code pages).
  • Pfx for prefix handling.
  • Tp for threadpool handling.

user32.dll and gdi32.dll include several other calls that execute an interrupt into kernel mode. These were not part of the original Windows NT design, as can be seen in Windows NT 3.5. However, due to performance issues of hardware of that age, it was decided to move the graphics subsystem into kernel mode. As such, system call in the range of 0x1000-0x1FFF are satisfied by win32k.sys (instead of ntoskrnl.exe as done for 0-0x0FFF), and are declared in user32.dll and gdi32.dll. These functions have the NtUser and NtGdi prefix (e.g. NtUserLockWorkStation and NtGdiEnableEudc).

Uses

Uses of Native API functions includes but not limited to:

  • Enabling and disabling privileges (RtlAdjustPrivilege)
  • Creating remote threads within processes that are running in different session (RtlCreateUserThread)
  • Running native applications (RtlCreateUserProcess)
  • Performing a forced shutdown (NtShutdownSystem)
  • Causing a BSOD in User mode (NtRaiseHardError)
  • Displaying a string in Native Mode (NtDisplayString)

See also

References

  1. ^ The NT Insider (August 27, 2003). "Nt vs. Zw - Clearing Confusion On The Native API". OSR Online. 10 (4). OSR Open Systems Resources. Retrieved 2013-09-16.
  2. ^ Raymond Chen (2009). "The Old New Thing : What does the "Zw" prefix mean?". Microsoft Corporation. Retrieved 2009-06-13.

Read other articles:

Hungarian chocolate cake Rigó JancsiAlternative namesGypsy JohnTypeCakePlace of originHungary and AustriaRegion or statein Hungary: nationwidein Austria: Viennain Italy: Triestein Croatia: RijekaMain ingredientsChocolate sponge cake (flour, butter, sugar, egg whites, chocolate, egg yolks)Filling: chocolate and cream icing, apricot jam, dark rum or vanilla Rigó Jancsi (Hungarian pronunciation: [ˈriɡoː ˈjɒnt͡ʃi]) is a traditional Hungarian cube-shaped chocolate sponge cake and cho…

Asi Kumis Status konservasi Risiko Rendah (IUCN 3.1)[1] Klasifikasi ilmiah Kerajaan: Animalia Filum: Chordata Kelas: Aves Ordo: Passeriformes Famili: Pellorneidae Genus: Malacopteron Spesies: M. magnirostre Nama binomial Malacopteron magnirostre(Moore, 1854) Asi kumis (Malacopteron magnirostre) adalah spesies burung dari keluarga Pellorneidae. Deskripsi Burung ini berukuran sekitar 16 cm, berwarna cokelat dengan ekor merah karat, mahkota cokelat buram, dan kumis abu-abu ge…

BambuRentang fosil: 55–0 jtyl PreЄ Є O S D C P T J K Pg N Eosen Awal – Sekarang(paling awal pada Kapur Akhir) Hutan bambu di Kyoto, Jepang Klasifikasi ilmiah Kerajaan: Plantae (tanpa takson): Angiospermae (tanpa takson): Monokotil (tanpa takson): Commelinids Ordo: Poales Famili: Poaceae Subfamili: Bambusoideae Tribus Arundinarieae Bambuseae Olyreae Diversitas[1] >1,462 (spesies diidentifikasi) spesies dalam 115 genera Sinonim[2] Olyroideae Pilg. (1956) Parianoideae …

العلاقات البحرينية التنزانية البحرين تنزانيا   البحرين   تنزانيا تعديل مصدري - تعديل   العلاقات البحرينية التنزانية هي العلاقات الثنائية التي تجمع بين البحرين وتنزانيا.[1][2][3][4][5] مقارنة بين البلدين هذه مقارنة عامة ومرجعية للدولتين: وجه المق…

Artikel ini sebatang kara, artinya tidak ada artikel lain yang memiliki pranala balik ke halaman ini.Bantulah menambah pranala ke artikel ini dari artikel yang berhubungan atau coba peralatan pencari pranala.Tag ini diberikan pada Desember 2023. Nagai Hina Nagai Hina atau Hina (lahir 7 April 2003) adalah seorang penyanyi Jepang. Ia merupakan satu-satunya anggota yang berasal dari Jepang dan menjadi sub-vokalis di grup Lightsum. Ia juga merupakan idola Jepang pertama yang ada di Cube Entertainmen…

Abduh Aziz Direktur Utama Produksi Film NegaraMasa jabatan2016 – 30 Juni 2019 Informasi pribadiLahirMohamad Abduh Aziz(1967-10-10)10 Oktober 1967Meninggal30 Juni 2019(2019-06-30) (umur 51)Jakarta, IndonesiaSuami/istriHeni WiradimajaAnak3Orang tuaAbdul Aziz (ayah)Alma materUniversitas IndonesiaPekerjaanProduser filmSunting kotak info • L • B Mohamad Abduh Aziz (10 Oktober 1967 – 30 Juni 2019) adalah seorang produser film asal Indonesia, yang juga meru…

BantarkawungKecamatanPeta lokasi Kecamatan BantarkawungNegara IndonesiaProvinsiJawa TengahKabupatenBrebesPemerintahan • CamatDrs. Eko Supriyanto, M.Si.Populasi • Total105,000 jiwaKode Kemendagri33.29.02 Kode BPS3329020 Desa/kelurahan18 Bantarkawung (Aksara Sunda: ᮘᮔ᮪ᮒᮁᮊᮝᮥᮀ) adalah salah satu kecamatan di bagian selatan Kabupaten Brebes, Jawa Tengah, Indonesia. Geografi Batas wilayah Utara Kecamatan Larangan, Kecamatan Ketanggungan Timur Kecamatan To…

Public school in the United StatesRogers Middle School for the Creative and Performing ArtsLocation5525 Columbo StreetPittsburgh PA 15206United StatesCoordinates40°28′08″N 79°55′50″W / 40.469019°N 79.930577°W / 40.469019; -79.930577InformationTypePublicMottoBelieve, Work to Achieve, and SucceedEstablishedSeptember 1979School districtPittsburgh Public SchoolsPrincipalDr. Ronald JonesStaff13Faculty40Grades6–8Enrollment315 as of 1 Oct 2007[1]Campus …

Political party in Morocco Not to be confused with Democratic Independent Party. This article relies largely or entirely on a single source. Relevant discussion may be found on the talk page. Please help improve this article by introducing citations to additional sources.Find sources: Democratic Independence Party – news · newspapers · books · scholar · JSTOR (May 2021) The Democratic Independence Party (French: Parti Démocratique et de l'Indépendance),…

У этого термина существуют и другие значения, см. Верба (значения). БМ-21У «Верба» Классификация реактивная система залпового огня Шасси КрАЗ-6322–010[1][2] История Страна-разработчик  Украина Годы производства с декабря 2015 Количество выпущенных 113[3] шт. Размер…

† Человек прямоходящий Научная классификация Домен:ЭукариотыЦарство:ЖивотныеПодцарство:ЭуметазоиБез ранга:Двусторонне-симметричныеБез ранга:ВторичноротыеТип:ХордовыеПодтип:ПозвоночныеИнфратип:ЧелюстноротыеНадкласс:ЧетвероногиеКлада:АмниотыКлада:СинапсидыКл…

Alternative medicine technique This article is about a chiropractic or an alternative medicine method. For the scientific study of human movement, see Kinesiology. Applied kinesiologyA chiropractor and a professional applied kinesiologist demonstrating a manual muscle test MMT of Psoas major and Iliacus muscles.Alternative therapyMeSHD018953This article is part of a series onAlternative medicine General information Alternative medicine History Terminology Alternative veterinary medicine Quackery…

1946 film by Henry Levin The Devil's MaskDirected byHenry LevinWritten byCharles O'NealDwight V. BabcockBased onI Love a Mystery1939-52 radio seriesby Carlton E. MorseProduced byWallace MacDonaldStarringAnita LouiseJim BannonMichael DuaneMona BarrieNarrated byFrank MartinCinematographyHenry FreulichEdited byJerome ThomsMusic byGeorge DuningIrving GertzProductioncompanyColumbia PicturesDistributed byColumbia PicturesRelease dateMay 23, 1946Running time65 minutesCountryUnited StatesLanguageEnglish…

Nijmegen NimwèègeKota madya dan munisipalitasPemandangan kota Nijmegen BenderaLambang kebesaranNegara BelandaProvinsiGelderlandUlpia Noviomagus Batavorum98–102PendiriTrajanusPemerintahan • Wali KotaHubert Bruls (CDA) • AldermenKunstVan der MeerJeeneBeertenFringsTankir • SecretaryVan der PloegLuas(2006) • Kota madya dan munisipalitas57,53 km2 (22,21 sq mi) • Luas daratan53,59 km2 (20,69 sq mi) …

Embassy in Jakarta, Indonesia Embassy of the United States, JakartaKedutaan Besar Amerika Serikat, JakartaLocationJalan Medan Merdeka Selatan No. 3-5Central JakartaAmbassadorMichael F. Klaine (Chargé d'affaires a.i.)Websiteid.usembassy.gov Marine guard post at the U.S. Embassy in Jakarta (circa 1970) The Embassy of the United States to the Republic of Indonesia is located in Jakarta just south of the Monas and the Presidential Palace at Jalan Medan Merdeka Selatan.[1] The original build…

State in NigeriaAkwa Ibom StateState FlagSealNicknames: Land of Promise, Akwa Abasi Ibom stateLocation of Akwa Ibom in NigeriaCoordinates: 05°00′N 07°50′E / 5.000°N 7.833°E / 5.000; 7.833Country NigeriaDate created23 September 1987CapitalUyoGovernment • BodyGovernment of Akwa Ibom State • GovernorPastor Umo Eno (PDP) • Deputy GovernorAkon Eyakenyi • LegislatureAkwa Ibom State House of Assembly • …

Alamo beralih ke halaman ini. Untuk kegunaan lain, lihat Alamo (disambiguasi). Pertempuran AlamoBagian dari Revolusi TexasAlamo pada tahun 1854.Tanggal23 Februari – 6 Maret 1836LokasiSan Antonio, TexasHasil Kemenangan MeksikoPihak terlibat  Republik Meksiko Republik TexasTokoh dan pemimpin Antonio López de Santa Anna William Travis †James Bowie †Kekuatan 2.400 182–260Korban 400–600 tewas atau terluka 180–258 tewas Pertempuran Alamo (23 Februari – 6 Maret 1836) …

内華達州 美國联邦州State of Nevada 州旗州徽綽號:產銀之州、起戰之州地图中高亮部分为内華達州坐标:35°N-42°N, 114°W-120°W国家 美國建州前內華達领地加入聯邦1864年10月31日(第36个加入联邦)首府卡森城最大城市拉斯维加斯政府 • 州长(英语:List of Governors of {{{Name}}}]]) • 副州长(英语:List of lieutenant governors of {{{Name}}}]])喬·隆巴爾多(R斯塔夫…

الفتنة الكبرى جزء من الصراعات الداخلية الإسلامية   المناطق التابعة لنفوذ علي بن أبي طالب   المناطق التابعة لنفوذ معاوية بن أبي سفيان   المناطق التابعة لنفوذ عمرو بن العاص معلومات عامة التاريخ 35هـ - 41هـ / 656 - 661م الموقع جزيرة العرب، العراق، الشام، الجزيرة الفرات…

Artikel ini bukan mengenai Jebel Akhdar (Oman). Aljabal Alakhdar (Libya) Jebel Akhdar (Arab: الجبل الأخضر al-Jabal al-Akhḍar, bahasa Indonesia: Gunung Hijau) adalah sebuah wilayah dataran tinggi berhutan di timur laut Libya. Tempat tersebut sekarang terletak di shabiyah atau distrik Derna, Jabal al Akhdar, dan Marj. Referensi Koordinat: 32°35′52″N 21°28′22″E / 32.597734°N 21.472778°E / 32.597734; 21.472778 Pengawasan otoritas Integrated Au…

Kembali kehalaman sebelumnya