ReactOS.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
List overview
Download
Ros-diffs
December 2018
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
ros-diffs@reactos.org
26 participants
322 discussions
Start a n
N
ew thread
[reactos] 01/06: [NTOS] Code formatting only.
by Hermès Bélusca-Maïto
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=d3a97e222875ffedec021…
commit d3a97e222875ffedec021828dd1454cfadbeb653 Author: Hermès Bélusca-Maïto <hermes.belusca-maito(a)reactos.org> AuthorDate: Sun Dec 30 13:40:09 2018 +0100 Commit: Hermès Bélusca-Maïto <hermes.belusca-maito(a)reactos.org> CommitDate: Sun Dec 30 15:26:35 2018 +0100 [NTOS] Code formatting only. --- ntoskrnl/fstub/disksup.c | 11 ++++------- ntoskrnl/io/iomgr/file.c | 15 ++++++--------- 2 files changed, 10 insertions(+), 16 deletions(-) diff --git a/ntoskrnl/fstub/disksup.c b/ntoskrnl/fstub/disksup.c index ef5630d0ee..e7ab0a7990 100644 --- a/ntoskrnl/fstub/disksup.c +++ b/ntoskrnl/fstub/disksup.c @@ -1503,8 +1503,7 @@ xHalIoReadPartitionTable(IN PDEVICE_OBJECT DeviceObject, if (!Offset.QuadPart) { /* Then read the signature off the disk */ - (*PartitionBuffer)->Signature = ((PULONG)Buffer) - [PARTITION_TABLE_OFFSET / 2 - 1]; + (*PartitionBuffer)->Signature = ((PULONG)Buffer)[PARTITION_TABLE_OFFSET / 2 - 1]; } /* Get the partition descriptor array */ @@ -1540,7 +1539,7 @@ xHalIoReadPartitionTable(IN PDEVICE_OBJECT DeviceObject, /* Make sure that the partition is valid, unless it's the first */ if (!(HalpIsValidPartitionEntry(PartitionDescriptor, MaxOffset, - MaxSector)) && !(j)) + MaxSector)) && (j == 0)) { /* It's invalid, so fail */ IsValid = FALSE; @@ -1722,9 +1721,7 @@ xHalIoReadPartitionTable(IN PDEVICE_OBJECT DeviceObject, /* Check if this is a removable device that's probably a super-floppy */ if ((DiskGeometry.MediaType == RemovableMedia) && - !(j) && - (MbrFound) && - (IsEmpty)) + (j == 0) && (MbrFound) && (IsEmpty)) { /* Read the jump bytes to detect super-floppy */ if ((BootSectorInfo->JumpByte[0] == 0xeb) || @@ -2133,7 +2130,7 @@ xHalIoWritePartitionTable(IN PDEVICE_OBJECT DeviceObject, if (((PULONG)Buffer)[PARTITION_TABLE_OFFSET / 2 - 1] != PartitionBuffer->Signature) { - /* Then write the signature and now w need a rewrite */ + /* Then write the signature and now we need a rewrite */ ((PULONG)Buffer)[PARTITION_TABLE_OFFSET / 2 - 1] = PartitionBuffer->Signature; DoRewrite = TRUE; diff --git a/ntoskrnl/io/iomgr/file.c b/ntoskrnl/io/iomgr/file.c index 6b6b2e4abe..a6132692ae 100644 --- a/ntoskrnl/io/iomgr/file.c +++ b/ntoskrnl/io/iomgr/file.c @@ -210,7 +210,7 @@ IopDoNameTransmogrify(IN PIRP Irp, } else { - /* Compute how much mem we'll need */ + /* Compute how much memory we'll need */ RequiredLength = DataBuffer->Reserved + Length + sizeof(UNICODE_NULL); /* Check if FileObject can already hold what we need */ @@ -224,7 +224,7 @@ IopDoNameTransmogrify(IN PIRP Irp, NewBuffer = ExAllocatePoolWithTag(PagedPool, RequiredLength, TAG_IO_NAME); if (NewBuffer == NULL) { - Irp->IoStatus.Status = STATUS_INSUFFICIENT_RESOURCES; + Irp->IoStatus.Status = STATUS_INSUFFICIENT_RESOURCES; } } } @@ -233,7 +233,7 @@ IopDoNameTransmogrify(IN PIRP Irp, /* Everything went right */ if (NT_SUCCESS(Irp->IoStatus.Status)) { - /* Copy reserved */ + /* Copy the reserved data */ if (DataBuffer->Reserved) { RtlMoveMemory((PWSTR)((ULONG_PTR)NewBuffer + Length), @@ -241,7 +241,7 @@ IopDoNameTransmogrify(IN PIRP Irp, DataBuffer->Reserved); } - /* Then, buffer */ + /* Then the buffer */ if (Length) { RtlCopyMemory(NewBuffer, Buffer, Length); @@ -958,12 +958,9 @@ IopParseDevice(IN PVOID ParseObject, if (RemainingName->Length) { /* Setup the unicode string */ - FileObject->FileName.MaximumLength = RemainingName->Length + - sizeof(WCHAR); + FileObject->FileName.MaximumLength = RemainingName->Length + sizeof(WCHAR); FileObject->FileName.Buffer = ExAllocatePoolWithTag(PagedPool, - FileObject-> - FileName. - MaximumLength, + FileObject->FileName.MaximumLength, TAG_IO_NAME); if (!FileObject->FileName.Buffer) {
5 years, 11 months
1
0
0
0
[reactos] 01/01: [UMPNPMGR] PNP_GetDeviceListSize: Implement the buffer size calculation for a list of all device instances.
by Eric Kohl
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=969de9062c6dc95b5e3c7…
commit 969de9062c6dc95b5e3c7a66a6c48dc03e03d534 Author: Eric Kohl <eric.kohl(a)reactos.org> AuthorDate: Sun Dec 30 14:42:12 2018 +0100 Commit: Eric Kohl <eric.kohl(a)reactos.org> CommitDate: Sun Dec 30 14:43:10 2018 +0100 [UMPNPMGR] PNP_GetDeviceListSize: Implement the buffer size calculation for a list of all device instances. --- base/services/umpnpmgr/umpnpmgr.c | 41 +++++++++++++++++++++++++++++++++++++-- 1 file changed, 39 insertions(+), 2 deletions(-) diff --git a/base/services/umpnpmgr/umpnpmgr.c b/base/services/umpnpmgr/umpnpmgr.c index 56faf3be3b..2583d135ef 100644 --- a/base/services/umpnpmgr/umpnpmgr.c +++ b/base/services/umpnpmgr/umpnpmgr.c @@ -886,6 +886,41 @@ GetEnumeratorInstanceListSize( } +static +CONFIGRET +GetAllInstanceListSize( + _In_ LPCWSTR pszEnumerator, + _Out_ PULONG pulLength) +{ + WCHAR szEnumeratorBuffer[MAX_DEVICE_ID_LEN]; + DWORD dwIndex, dwEnumeratorLength, dwBufferLength; + DWORD dwError; + CONFIGRET ret = CR_SUCCESS; + + for (dwIndex = 0; ; dwIndex++) + { + dwEnumeratorLength = MAX_DEVICE_ID_LEN; + dwError = RegEnumKeyExW(hEnumKey, + dwIndex, + szEnumeratorBuffer, + &dwEnumeratorLength, + NULL, NULL, NULL, NULL); + if (dwError != ERROR_SUCCESS) + break; + + /* Get the size of all device instances for the enumerator */ + ret = GetEnumeratorInstanceListSize(szEnumeratorBuffer, + &dwBufferLength); + if (ret != CR_SUCCESS) + break; + + *pulLength += dwBufferLength; + } + + return ret; +} + + /* Function 11 */ DWORD WINAPI @@ -902,7 +937,8 @@ PNP_GetDeviceListSize( CONFIGRET ret = CR_SUCCESS; NTSTATUS Status; - DPRINT("PNP_GetDeviceListSize() called\n"); + DPRINT("PNP_GetDeviceListSize(%p %S %p 0x%lx)\n", + hBinding, pszFilter, pulLength, ulFlags); if (ulFlags & ~CM_GETIDLIST_FILTER_BITS) return CR_INVALID_FLAG; @@ -980,7 +1016,8 @@ PNP_GetDeviceListSize( } else /* CM_GETIDLIST_FILTER_NONE */ { - ret = CR_CALL_NOT_IMPLEMENTED; + ret = GetAllInstanceListSize(pszFilter, + pulLength); } /* Add one character for the terminating double UNICODE_NULL */
5 years, 11 months
1
0
0
0
[reactos] 06/06: [SERVICES] Implement ScmGenerateServiceTag and call it on service creation
by Pierre Schweitzer
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=1a9b9800b1766b9301ea6…
commit 1a9b9800b1766b9301ea68d3dc5b882200c8f931 Author: Pierre Schweitzer <pierre(a)reactos.org> AuthorDate: Sun Dec 30 14:09:54 2018 +0100 Commit: Pierre Schweitzer <pierre(a)reactos.org> CommitDate: Sun Dec 30 14:27:04 2018 +0100 [SERVICES] Implement ScmGenerateServiceTag and call it on service creation This allows assigning an unique ServiceTag to each Win32 service --- base/system/services/database.c | 26 ++++++++++++++++++++++++++ base/system/services/rpcserver.c | 4 ++++ base/system/services/services.h | 2 ++ 3 files changed, 32 insertions(+) diff --git a/base/system/services/database.c b/base/system/services/database.c index be6290bef6..26172a7a94 100644 --- a/base/system/services/database.c +++ b/base/system/services/database.c @@ -31,6 +31,7 @@ LIST_ENTRY ServiceListHead; static RTL_RESOURCE DatabaseLock; static DWORD ResumeCount = 1; static DWORD NoInteractiveServices = 0; +static DWORD ServiceTag = 0; /* The critical section synchronizes service control requests */ static CRITICAL_SECTION ControlServiceCriticalSection; @@ -634,6 +635,29 @@ ScmGetServiceEntryByResumeCount(DWORD dwResumeCount) } +DWORD +ScmGenerateServiceTag(PSERVICE lpServiceRecord) +{ + /* Check for an overflow */ + if (ServiceTag == -1) + { + return ERROR_INVALID_DATA; + } + + /* This is only valid for Win32 services */ + if (!(lpServiceRecord->Status.dwServiceType & SERVICE_WIN32)) + { + return ERROR_INVALID_PARAMETER; + } + + /* Increment the tag counter and set it */ + ServiceTag = ServiceTag % 0xFFFFFFFF + 1; + lpServiceRecord->dwTag = ServiceTag; + + return ERROR_SUCCESS; +} + + DWORD ScmCreateNewServiceRecord(LPCWSTR lpServiceName, PSERVICE *lpServiceRecord, @@ -847,6 +871,8 @@ CreateServiceListEntry(LPCWSTR lpServiceName, if (ScmIsDeleteFlagSet(hServiceKey)) lpService->bDeleted = TRUE; + else + ScmGenerateServiceTag(lpService); if (lpService->Status.dwServiceType & SERVICE_WIN32) { diff --git a/base/system/services/rpcserver.c b/base/system/services/rpcserver.c index b11db5ae0e..83d83dd9c9 100644 --- a/base/system/services/rpcserver.c +++ b/base/system/services/rpcserver.c @@ -2636,6 +2636,10 @@ RCreateServiceW( goto done; lpService->dwRefCount = 1; + + /* Get the service tag (if Win32) */ + ScmGenerateServiceTag(lpService); + DPRINT("CreateService - lpService->dwRefCount %u\n", lpService->dwRefCount); done: diff --git a/base/system/services/services.h b/base/system/services/services.h index 4e6f1f1810..9297c7ce99 100644 --- a/base/system/services/services.h +++ b/base/system/services/services.h @@ -200,6 +200,8 @@ VOID ScmDeleteNamedPipeCriticalSection(VOID); DWORD ScmGetServiceNameFromTag(PTAG_INFO_NAME_FROM_TAG_IN_PARAMS InParams, PTAG_INFO_NAME_FROM_TAG_OUT_PARAMS *OutParams); +DWORD ScmGenerateServiceTag(PSERVICE lpServiceRecord); + /* driver.c */ DWORD ScmStartDriver(PSERVICE lpService);
5 years, 11 months
1
0
0
0
[reactos] 05/06: [SERVICES] Implement ScmGetServiceNameFromTag
by Pierre Schweitzer
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=519a2c9f6f763713b57a2…
commit 519a2c9f6f763713b57a29c0fa311eca0c2fa250 Author: Pierre Schweitzer <pierre(a)reactos.org> AuthorDate: Sun Dec 30 13:31:08 2018 +0100 Commit: Pierre Schweitzer <pierre(a)reactos.org> CommitDate: Sun Dec 30 14:27:04 2018 +0100 [SERVICES] Implement ScmGetServiceNameFromTag --- base/system/services/database.c | 78 +++++++++++++++++++++++++++++++++++++++-- 1 file changed, 76 insertions(+), 2 deletions(-) diff --git a/base/system/services/database.c b/base/system/services/database.c index fc4dd2f561..be6290bef6 100644 --- a/base/system/services/database.c +++ b/base/system/services/database.c @@ -148,8 +148,82 @@ ScmGetServiceImageByImagePath(LPWSTR lpImagePath) DWORD ScmGetServiceNameFromTag(PTAG_INFO_NAME_FROM_TAG_IN_PARAMS InParams, PTAG_INFO_NAME_FROM_TAG_OUT_PARAMS *OutParams) { - UNIMPLEMENTED; - return ERROR_CALL_NOT_IMPLEMENTED; + PLIST_ENTRY ServiceEntry; + PSERVICE CurrentService; + PSERVICE_IMAGE CurrentImage; + PTAG_INFO_NAME_FROM_TAG_OUT_PARAMS OutBuffer = NULL; + DWORD dwError; + + /* Lock the database */ + ScmLockDatabaseExclusive(); + + /* Find the matching service */ + ServiceEntry = ServiceListHead.Flink; + while (ServiceEntry != &ServiceListHead) + { + CurrentService = CONTAINING_RECORD(ServiceEntry, + SERVICE, + ServiceListEntry); + + /* We must match the tag */ + if (CurrentService->dwTag == InParams->dwTag && + CurrentService->lpImage != NULL) + { + CurrentImage = CurrentService->lpImage; + /* And matching the PID */ + if (CurrentImage->hProcess == (HANDLE)InParams->dwPid) + { + break; + } + } + + ServiceEntry = ServiceEntry->Flink; + } + + /* No match! */ + if (ServiceEntry == &ServiceListHead) + { + dwError = ERROR_RETRY; + goto Cleanup; + } + + /* Allocate the output buffer */ + OutBuffer = MIDL_user_allocate(sizeof(TAG_INFO_NAME_FROM_TAG_OUT_PARAMS)); + if (OutBuffer == NULL) + { + dwError = ERROR_NOT_ENOUGH_MEMORY; + goto Cleanup; + } + + /* And the buffer for the name */ + OutBuffer->pszName = MIDL_user_allocate(wcslen(CurrentService->lpServiceName) * sizeof(WCHAR) + sizeof(UNICODE_NULL)); + if (OutBuffer->pszName == NULL) + { + dwError = ERROR_NOT_ENOUGH_MEMORY; + goto Cleanup; + } + + /* Fill in output data */ + wcscpy(OutBuffer->pszName, CurrentService->lpServiceName); + OutBuffer->TagType = TagTypeService; + + /* And return */ + *OutParams = OutBuffer; + dwError = ERROR_SUCCESS; + +Cleanup: + + /* Unlock database */ + ScmUnlockDatabase(); + + /* If failure, free allocated memory */ + if (dwError != ERROR_SUCCESS) + { + MIDL_user_free(OutBuffer); + } + + /* Return error/success */ + return dwError; }
5 years, 11 months
1
0
0
0
[reactos] 04/06: [SERVICES] Implement RI_ScQueryServiceTagInfo
by Pierre Schweitzer
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=90f5e6b6c322aeb5ad7d4…
commit 90f5e6b6c322aeb5ad7d47d29f2d6c55a961a36b Author: Pierre Schweitzer <pierre(a)reactos.org> AuthorDate: Sun Dec 30 12:25:18 2018 +0100 Commit: Pierre Schweitzer <pierre(a)reactos.org> CommitDate: Sun Dec 30 14:27:03 2018 +0100 [SERVICES] Implement RI_ScQueryServiceTagInfo --- base/system/services/database.c | 8 ++++++++ base/system/services/rpcserver.c | 34 ++++++++++++++++++++++++++++++++-- base/system/services/services.h | 2 ++ 3 files changed, 42 insertions(+), 2 deletions(-) diff --git a/base/system/services/database.c b/base/system/services/database.c index ea91a5cb45..fc4dd2f561 100644 --- a/base/system/services/database.c +++ b/base/system/services/database.c @@ -145,6 +145,14 @@ ScmGetServiceImageByImagePath(LPWSTR lpImagePath) } +DWORD +ScmGetServiceNameFromTag(PTAG_INFO_NAME_FROM_TAG_IN_PARAMS InParams, PTAG_INFO_NAME_FROM_TAG_OUT_PARAMS *OutParams) +{ + UNIMPLEMENTED; + return ERROR_CALL_NOT_IMPLEMENTED; +} + + static BOOL ScmIsSameServiceAccount( diff --git a/base/system/services/rpcserver.c b/base/system/services/rpcserver.c index 5b243f7f89..b11db5ae0e 100644 --- a/base/system/services/rpcserver.c +++ b/base/system/services/rpcserver.c @@ -6586,8 +6586,38 @@ RI_ScQueryServiceTagInfo( PTAG_INFO_NAME_FROM_TAG_IN_PARAMS * lpInParams, PTAG_INFO_NAME_FROM_TAG_OUT_PARAMS * lpOutParams) { - UNIMPLEMENTED; - return ERROR_CALL_NOT_IMPLEMENTED; + PMANAGER_HANDLE hManager; + + /* Validate handle */ + hManager = ScmGetServiceManagerFromHandle(hSCManager); + if (hManager == NULL) + { + return ERROR_INVALID_HANDLE; + } + + /* FIXME: should check whether client is local */ + + /* Check access rights */ + if (!RtlAreAllAccessesGranted(hManager->Handle.DesiredAccess, + SC_MANAGER_ENUMERATE_SERVICE)) + { + return ERROR_ACCESS_DENIED; + } + + /* Check parameters */ + if (lpInParams == NULL || lpOutParams == NULL) + { + return ERROR_INVALID_PARAMETER; + } + + /* Check info level */ + if (dwInfoLevel != TagInfoLevelNameFromTag) + { + return ERROR_RETRY; + } + + /* Call internal helper */ + return ScmGetServiceNameFromTag(*lpInParams, lpOutParams); } diff --git a/base/system/services/services.h b/base/system/services/services.h index 74943372c6..4e6f1f1810 100644 --- a/base/system/services/services.h +++ b/base/system/services/services.h @@ -197,6 +197,8 @@ VOID ScmUnlockDatabase(VOID); VOID ScmInitNamedPipeCriticalSection(VOID); VOID ScmDeleteNamedPipeCriticalSection(VOID); +DWORD ScmGetServiceNameFromTag(PTAG_INFO_NAME_FROM_TAG_IN_PARAMS InParams, + PTAG_INFO_NAME_FROM_TAG_OUT_PARAMS *OutParams); /* driver.c */
5 years, 11 months
1
0
0
0
[reactos] 03/06: [ADVAPI32] Implement I_ScQueryServiceTagInfo
by Pierre Schweitzer
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=e29a99245b8bdd299202a…
commit e29a99245b8bdd299202a165fa11e753274af285 Author: Pierre Schweitzer <pierre(a)reactos.org> AuthorDate: Sun Dec 30 12:12:40 2018 +0100 Commit: Pierre Schweitzer <pierre(a)reactos.org> CommitDate: Sun Dec 30 14:27:03 2018 +0100 [ADVAPI32] Implement I_ScQueryServiceTagInfo --- dll/win32/advapi32/service/scm.c | 90 +++++++++++++++++++++++++++++++++++++++- 1 file changed, 89 insertions(+), 1 deletion(-) diff --git a/dll/win32/advapi32/service/scm.c b/dll/win32/advapi32/service/scm.c index 08baad1cb9..0588caef19 100644 --- a/dll/win32/advapi32/service/scm.c +++ b/dll/win32/advapi32/service/scm.c @@ -5,6 +5,7 @@ * PURPOSE: Service control manager functions * PROGRAMMER: Emanuele Aliberti * Eric Kohl + * Pierre Schweitzer */ /* INCLUDES ******************************************************************/ @@ -3027,7 +3028,94 @@ I_ScQueryServiceTagInfo(PVOID Unused, TAG_INFO_LEVEL dwInfoLevel, PTAG_INFO_NAME_FROM_TAG InOutParams) { - return ERROR_CALL_NOT_IMPLEMENTED; + SC_HANDLE hScm; + DWORD dwError; + PTAG_INFO_NAME_FROM_TAG_IN_PARAMS InParams; + PTAG_INFO_NAME_FROM_TAG_OUT_PARAMS OutParams; + LPWSTR lpszName; + + /* We only support one class */ + if (dwInfoLevel != TagInfoLevelNameFromTag) + { + return ERROR_RETRY; + } + + /* Validate input structure */ + if (InOutParams->InParams.dwPid == 0 || InOutParams->InParams.dwTag == 0) + { + return ERROR_INVALID_PARAMETER; + } + + /* Validate output structure */ + if (InOutParams->OutParams.pszName != NULL) + { + return ERROR_INVALID_PARAMETER; + } + + /* Open service manager */ + hScm = OpenSCManagerW(NULL, NULL, SC_MANAGER_ENUMERATE_SERVICE); + if (hScm == NULL) + { + return GetLastError(); + } + + /* Setup call parameters */ + InParams = &InOutParams->InParams; + OutParams = NULL; + + /* Call SCM to query tag information */ + RpcTryExcept + { + dwError = RI_ScQueryServiceTagInfo(hScm, TagInfoLevelNameFromTag, &InParams, &OutParams); + } + RpcExcept(EXCEPTION_EXECUTE_HANDLER) + { + dwError = ScmRpcStatusToWinError(RpcExceptionCode()); + } + RpcEndExcept; + + /* Quit if not a success */ + if (dwError != ERROR_SUCCESS) + { + goto Cleanup; + } + + /* OutParams must be set now and we must have a name */ + if (OutParams == NULL || + OutParams->pszName == NULL) + { + dwError = ERROR_INVALID_DATA; + goto Cleanup; + } + + /* Copy back what SCM returned */ + lpszName = LocalAlloc(LPTR, + sizeof(WCHAR) * wcslen(OutParams->pszName) + sizeof(UNICODE_NULL)); + if (lpszName == NULL) + { + dwError = GetLastError(); + goto Cleanup; + } + + wcscpy(lpszName, OutParams->pszName); + InOutParams->OutParams.pszName = lpszName; + InOutParams->OutParams.TagType = OutParams->TagType; + +Cleanup: + CloseServiceHandle(hScm); + + /* Free memory allocated by SCM */ + if (OutParams != NULL) + { + if (OutParams->pszName != NULL) + { + midl_user_free(OutParams->pszName); + } + + midl_user_free(OutParams); + } + + return dwError; } /**********************************************************************
5 years, 11 months
1
0
0
0
[reactos] 02/06: [ADVAPI32] Implement I_QueryTagInformation
by Pierre Schweitzer
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=19304da5c3b725f979e08…
commit 19304da5c3b725f979e081cd18e5290bf92e2080 Author: Pierre Schweitzer <pierre(a)reactos.org> AuthorDate: Sun Dec 30 11:52:37 2018 +0100 Commit: Pierre Schweitzer <pierre(a)reactos.org> CommitDate: Sun Dec 30 14:27:02 2018 +0100 [ADVAPI32] Implement I_QueryTagInformation --- dll/win32/advapi32/advapi32.spec | 2 +- dll/win32/advapi32/service/scm.c | 44 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 45 insertions(+), 1 deletion(-) diff --git a/dll/win32/advapi32/advapi32.spec b/dll/win32/advapi32/advapi32.spec index 3414463328..5a571db55a 100644 --- a/dll/win32/advapi32/advapi32.spec +++ b/dll/win32/advapi32/advapi32.spec @@ -294,7 +294,7 @@ 294 stdcall GetUserNameA(ptr ptr) 295 stdcall GetUserNameW(ptr ptr) 296 stdcall GetWindowsAccountDomainSid(ptr ptr ptr) -297 stub I_QueryTagInformation +297 stdcall I_QueryTagInformation(ptr long ptr) 298 stdcall I_ScIsSecurityProcess() 299 stdcall I_ScPnPGetServiceName(ptr wstr long) 300 stub I_ScSendTSMessage diff --git a/dll/win32/advapi32/service/scm.c b/dll/win32/advapi32/service/scm.c index 1fe96213a1..08baad1cb9 100644 --- a/dll/win32/advapi32/service/scm.c +++ b/dll/win32/advapi32/service/scm.c @@ -3022,4 +3022,48 @@ NotifyBootConfigStatus(BOOL BootAcceptable) return TRUE; } +DWORD +I_ScQueryServiceTagInfo(PVOID Unused, + TAG_INFO_LEVEL dwInfoLevel, + PTAG_INFO_NAME_FROM_TAG InOutParams) +{ + return ERROR_CALL_NOT_IMPLEMENTED; +} + +/********************************************************************** + * I_QueryTagInformation + * + * @implemented + */ +DWORD WINAPI +I_QueryTagInformation(PVOID Unused, + TAG_INFO_LEVEL dwInfoLevel, + PTAG_INFO_NAME_FROM_TAG InOutParams) +{ + /* + * We only support one information class and it + * needs parameters + */ + if (dwInfoLevel != TagInfoLevelNameFromTag || + InOutParams == NULL) + { + return ERROR_INVALID_PARAMETER; + } + + /* Validate input structure */ + if (InOutParams->InParams.dwPid == 0 || InOutParams->InParams.dwTag == 0) + { + return ERROR_INVALID_PARAMETER; + } + + /* Validate output structure */ + if (InOutParams->OutParams.pszName != NULL) + { + return ERROR_INVALID_PARAMETER; + } + + /* Call internal function for the RPC call */ + return I_ScQueryServiceTagInfo(Unused, TagInfoLevelNameFromTag, InOutParams); +} + /* EOF */
5 years, 11 months
1
0
0
0
[reactos] 01/06: [SERVICES] Define the RI_ScQueryServiceTagInfo RPC call
by Pierre Schweitzer
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=dfaee51f98f9c2571a29a…
commit dfaee51f98f9c2571a29af80906130f1f3c7da43 Author: Pierre Schweitzer <pierre(a)reactos.org> AuthorDate: Sun Dec 30 11:45:08 2018 +0100 Commit: Pierre Schweitzer <pierre(a)reactos.org> CommitDate: Sun Dec 30 14:26:57 2018 +0100 [SERVICES] Define the RI_ScQueryServiceTagInfo RPC call All the definitions are taken from ProcessHacker:
https://github.com/processhacker/processhacker/blob/master/phnt/include/sub…
--- base/system/services/rpcserver.c | 7 +++++-- sdk/include/reactos/idl/svcctl.idl | 31 +++++++++++++++++++++++++++++-- 2 files changed, 34 insertions(+), 4 deletions(-) diff --git a/base/system/services/rpcserver.c b/base/system/services/rpcserver.c index 7f251c8760..5b243f7f89 100644 --- a/base/system/services/rpcserver.c +++ b/base/system/services/rpcserver.c @@ -6580,8 +6580,11 @@ RCreateServiceWOW64W( /* Function 46 */ DWORD WINAPI -RQueryServiceTagInfo( - handle_t BindingHandle) /* FIXME */ +RI_ScQueryServiceTagInfo( + SC_RPC_HANDLE hSCManager, + TAG_INFO_LEVEL dwInfoLevel, + PTAG_INFO_NAME_FROM_TAG_IN_PARAMS * lpInParams, + PTAG_INFO_NAME_FROM_TAG_OUT_PARAMS * lpOutParams) { UNIMPLEMENTED; return ERROR_CALL_NOT_IMPLEMENTED; diff --git a/sdk/include/reactos/idl/svcctl.idl b/sdk/include/reactos/idl/svcctl.idl index 36234e74e1..c16efb623d 100644 --- a/sdk/include/reactos/idl/svcctl.idl +++ b/sdk/include/reactos/idl/svcctl.idl @@ -296,6 +296,30 @@ typedef struct _STRING_PTRSW { [string] LPWSTR StringPtr; } STRING_PTRSW, *PSTRING_PTRSW, *LPSTRING_PTRSW; +typedef [v1_enum] enum _TAG_INFO_LEVEL { + TagInfoLevelNameFromTag = 1, +} TAG_INFO_LEVEL; + +typedef [v1_enum] enum _TAG_TYPE { + TagTypeService = 1, +} TAG_TYPE; + +typedef struct _TAG_INFO_NAME_FROM_TAG_IN_PARAMS { + DWORD dwPid; + DWORD dwTag; +} TAG_INFO_NAME_FROM_TAG_IN_PARAMS, *PTAG_INFO_NAME_FROM_TAG_IN_PARAMS; + +typedef struct _TAG_INFO_NAME_FROM_TAG_OUT_PARAMS { + TAG_TYPE TagType; + LPWSTR pszName; +} TAG_INFO_NAME_FROM_TAG_OUT_PARAMS, *PTAG_INFO_NAME_FROM_TAG_OUT_PARAMS; + +typedef struct _TAG_INFO_NAME_FROM_TAG +{ + TAG_INFO_NAME_FROM_TAG_IN_PARAMS InParams; + TAG_INFO_NAME_FROM_TAG_OUT_PARAMS OutParams; +} TAG_INFO_NAME_FROM_TAG, *PTAG_INFO_NAME_FROM_TAG; + [ uuid(367abb81-9844-35f1-ad32-98f038001003), version(2.0), @@ -798,8 +822,11 @@ interface svcctl /* Function 46 */ DWORD __stdcall - RQueryServiceTagInfo( - [in] handle_t BindingHandle); /* FIXME */ + RI_ScQueryServiceTagInfo( + [in] SC_RPC_HANDLE hSCManager, + [in] TAG_INFO_LEVEL dwInfoLevel, + [in] PTAG_INFO_NAME_FROM_TAG_IN_PARAMS * lpInParams, + [out] PTAG_INFO_NAME_FROM_TAG_OUT_PARAMS * lpOutParams); /* Function 47 */ DWORD
5 years, 11 months
1
0
0
0
[reactos] 01/01: [UMPNPMGR] PNP_GetDeviceList: Implement the enumeration of device instances for a given enumerator.
by Eric Kohl
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=4f37d9685774da5ba628a…
commit 4f37d9685774da5ba628a1e92f69a891553cc3e0 Author: Eric Kohl <eric.kohl(a)reactos.org> AuthorDate: Sun Dec 30 12:55:31 2018 +0100 Commit: Eric Kohl <eric.kohl(a)reactos.org> CommitDate: Sun Dec 30 12:58:30 2018 +0100 [UMPNPMGR] PNP_GetDeviceList: Implement the enumeration of device instances for a given enumerator. --- base/services/umpnpmgr/umpnpmgr.c | 75 ++++++++++++++++++++++++++++++++++++++- 1 file changed, 74 insertions(+), 1 deletion(-) diff --git a/base/services/umpnpmgr/umpnpmgr.c b/base/services/umpnpmgr/umpnpmgr.c index bae7fdda21..56faf3be3b 100644 --- a/base/services/umpnpmgr/umpnpmgr.c +++ b/base/services/umpnpmgr/umpnpmgr.c @@ -544,6 +544,7 @@ GetDeviceInstanceList( PWSTR pPtr; CONFIGRET ret = CR_SUCCESS; + /* Open the device key */ dwError = RegOpenKeyExW(hEnumKey, pszDevice, 0, @@ -600,6 +601,76 @@ GetDeviceInstanceList( } +CONFIGRET +GetEnumeratorInstanceList( + _In_ PWSTR pszEnumerator, + _Inout_ PWSTR pszBuffer, + _Inout_ PDWORD pulLength) +{ + WCHAR szDeviceBuffer[MAX_DEVICE_ID_LEN]; + WCHAR szPathBuffer[512]; + HKEY hEnumeratorKey; + PWSTR pPtr; + DWORD dwIndex, dwDeviceLength, dwUsedLength, dwRemainingLength, dwPathLength; + DWORD dwError; + CONFIGRET ret = CR_SUCCESS; + + /* Open the enumerator key */ + dwError = RegOpenKeyExW(hEnumKey, + pszEnumerator, + 0, + KEY_ENUMERATE_SUB_KEYS, + &hEnumeratorKey); + if (dwError != ERROR_SUCCESS) + { + DPRINT("Failed to open the enumerator key (Error %lu)\n", dwError); + return CR_REGISTRY_ERROR; + } + + dwUsedLength = 0; + dwRemainingLength = *pulLength; + pPtr = pszBuffer; + + for (dwIndex = 0; ; dwIndex++) + { + dwDeviceLength = MAX_DEVICE_ID_LEN; + dwError = RegEnumKeyExW(hEnumeratorKey, + dwIndex, + szDeviceBuffer, + &dwDeviceLength, + NULL, + NULL, + NULL, + NULL); + if (dwError != ERROR_SUCCESS) + break; + + wsprintf(szPathBuffer, L"%s\\%s", pszEnumerator, szDeviceBuffer); + DPRINT("Path: %S\n", szPathBuffer); + + dwPathLength = dwRemainingLength; + ret = GetDeviceInstanceList(szPathBuffer, + pPtr, + &dwPathLength); + if (ret != CR_SUCCESS) + break; + + dwUsedLength += dwPathLength - 1; + dwRemainingLength += dwPathLength - 1; + pPtr += dwPathLength - 1; + } + + RegCloseKey(hEnumeratorKey); + + if (ret == CR_SUCCESS) + *pulLength = dwUsedLength + 1; + else + *pulLength = 0; + + return ret; +} + + /* Function 10 */ DWORD WINAPI @@ -688,7 +759,9 @@ PNP_GetDeviceList( } else { - ret = CR_CALL_NOT_IMPLEMENTED; + ret = GetEnumeratorInstanceList(pszFilter, + Buffer, + pulLength); } } else /* CM_GETIDLIST_FILTER_NONE */
5 years, 11 months
1
0
0
0
[reactos] 01/01: [NDK][NTOS] Add global definition of INIT_FUNCTION/INIT_SECTION (#779)
by Timo Kreuzer
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=71fefa32db013317842fd…
commit 71fefa32db013317842fd9224b63bcf5f72f2e32 Author: Timo Kreuzer <timo.kreuzer(a)reactos.org> AuthorDate: Sun Dec 30 12:19:11 2018 +0100 Commit: GitHub <noreply(a)github.com> CommitDate: Sun Dec 30 12:19:11 2018 +0100 [NDK][NTOS] Add global definition of INIT_FUNCTION/INIT_SECTION (#779) * Add an NDK header to define INIT_FUNCTION/INIT_SECTION globally * Use _declspec(allocate(x)) and _declspec(code_seg(x)) on MSVC versions that support it * Use INIT_FUNCTION on functions only and INIT_SECTION on data only (required by MSVC) * Place INIT_FUNCTION before the return type (required by MSVC) * Make sure declarations and implementations share the same modifiers (required by MSVC) * Add a global linker option to suppress warnings about defined but unused INIT section * Merge INIT section into .text in freeldr --- boot/freeldr/freeldr/CMakeLists.txt | 4 ++-- boot/freeldr/freeldr/freeldr_i386.lds | 2 ++ drivers/filesystems/fastfat/fastio.c | 2 +- drivers/filesystems/fastfat/iface.c | 2 +- drivers/filesystems/fastfat/vfat.h | 9 +++----- drivers/filesystems/mup/dfs.c | 2 +- drivers/filesystems/mup/dfs.h | 10 +++++++++ drivers/filesystems/mup/mup.c | 9 +++++--- drivers/filesystems/mup/mup.h | 7 +----- drivers/filesystems/ntfs/ntfs.c | 4 ++-- drivers/filesystems/ntfs/ntfs.h | 9 +++----- hal/halx86/acpi/busemul.c | 1 + hal/halx86/acpi/halacpi.c | 7 ++++++ hal/halx86/apic/rtctimer.c | 2 +- hal/halx86/generic/cmos.c | 2 +- hal/halx86/generic/dma.c | 2 +- hal/halx86/generic/halinit.c | 5 +++-- hal/halx86/generic/misc.c | 4 ++-- hal/halx86/generic/timer.c | 2 +- hal/halx86/generic/usage.c | 17 +++++++++------ hal/halx86/include/bus.h | 5 +++++ hal/halx86/include/halacpi.h | 1 + hal/halx86/include/halp.h | 26 ++++++++++++++-------- hal/halx86/legacy/bus/pcibus.c | 10 ++++----- hal/halx86/legacy/bus/sysbus.c | 1 + hal/halx86/legacy/bussupp.c | 41 ++++++++++++++++++++++------------- hal/halx86/legacy/halpcat.c | 12 +++++----- hal/halx86/up/halinit_mini.c | 1 + ntoskrnl/cache/newcc.h | 3 +++ ntoskrnl/cc/cacheman.c | 4 ++-- ntoskrnl/config/cmalloc.c | 4 ++-- ntoskrnl/config/cmboot.c | 20 ++++++++--------- ntoskrnl/config/cmconfig.c | 6 ++--- ntoskrnl/config/cmcontrl.c | 6 ++--- ntoskrnl/config/cmdata.c | 8 +++---- ntoskrnl/config/cmdelay.c | 4 ++-- ntoskrnl/config/cmhook.c | 2 +- ntoskrnl/config/cmkcbncb.c | 2 +- ntoskrnl/config/cmsysini.c | 20 ++++++++--------- ntoskrnl/ex/handle.c | 2 +- ntoskrnl/ex/hdlsterm.c | 2 +- ntoskrnl/ex/init.c | 24 ++++++++++---------- ntoskrnl/ex/lookas.c | 6 ++--- ntoskrnl/ex/pushlock.c | 2 +- ntoskrnl/ex/resource.c | 2 +- ntoskrnl/ex/xipdisp.c | 4 ++-- ntoskrnl/fsrtl/fsrtlpc.c | 4 ++-- ntoskrnl/fsrtl/stackovf.c | 2 +- ntoskrnl/inbv/inbv.c | 18 +++++++-------- ntoskrnl/include/internal/amd64/mm.h | 1 + ntoskrnl/include/internal/cc.h | 3 +++ ntoskrnl/include/internal/cm.h | 17 ++++++++++++++- ntoskrnl/include/internal/dbgk.h | 1 + ntoskrnl/include/internal/ex.h | 20 +++++++++++++++++ ntoskrnl/include/internal/fsrtl.h | 3 +++ ntoskrnl/include/internal/i386/ke.h | 21 +++++++++++++++++- ntoskrnl/include/internal/inbv.h | 8 +++++++ ntoskrnl/include/internal/io.h | 13 +++++++++++ ntoskrnl/include/internal/ke.h | 9 ++++++++ ntoskrnl/include/internal/lpc.h | 1 + ntoskrnl/include/internal/mm.h | 15 ++++++++++++- ntoskrnl/include/internal/ntoskrnl.h | 11 +--------- ntoskrnl/include/internal/ob.h | 3 +++ ntoskrnl/include/internal/po.h | 2 ++ ntoskrnl/include/internal/ps.h | 4 ++++ ntoskrnl/include/internal/se.h | 7 ++++++ ntoskrnl/io/iomgr/arcname.c | 12 +++++----- ntoskrnl/io/iomgr/driver.c | 8 +++---- ntoskrnl/io/iomgr/ramdisk.c | 2 +- ntoskrnl/io/iomgr/rawfs.c | 2 +- ntoskrnl/io/pnpmgr/pnpinit.c | 4 ++-- ntoskrnl/io/pnpmgr/pnpmgr.c | 10 ++++++--- ntoskrnl/ke/amd64/kiinit.c | 2 ++ ntoskrnl/ke/config.c | 4 ++-- ntoskrnl/ke/i386/cpu.c | 32 +++++++++++++-------------- ntoskrnl/ke/i386/kiinit.c | 12 +++++----- ntoskrnl/ke/i386/mtrr.c | 4 ++-- ntoskrnl/ke/i386/patpge.c | 6 ++--- ntoskrnl/ke/krnlinit.c | 8 +++---- ntoskrnl/lpc/port.c | 2 +- ntoskrnl/mm/ARM3/expool.c | 6 ++--- ntoskrnl/mm/ARM3/i386/init.c | 6 ++--- ntoskrnl/mm/ARM3/largepag.c | 6 ++--- ntoskrnl/mm/ARM3/miarm.h | 20 ++++++++++++++++- ntoskrnl/mm/ARM3/mminit.c | 40 +++++++++++++++++----------------- ntoskrnl/mm/ARM3/pool.c | 6 ++--- ntoskrnl/mm/ARM3/procsup.c | 4 ++-- ntoskrnl/mm/ARM3/sysldr.c | 12 +++++----- ntoskrnl/mm/ARM3/syspte.c | 2 +- ntoskrnl/mm/mminit.c | 10 ++++----- ntoskrnl/ob/obinit.c | 2 +- ntoskrnl/ob/obname.c | 4 ++-- ntoskrnl/ob/obsdcach.c | 2 +- ntoskrnl/po/power.c | 4 ++-- ntoskrnl/ps/apphelp.c | 2 +- ntoskrnl/ps/job.c | 2 +- ntoskrnl/ps/psmgr.c | 18 +++++++-------- ntoskrnl/ps/quota.c | 2 +- ntoskrnl/se/semgr.c | 9 ++++---- ntoskrnl/vdm/vdmmain.c | 4 ++-- sdk/cmake/msvc.cmake | 6 ++--- sdk/include/ndk/halfuncs.h | 3 +++ sdk/include/ndk/inbvfuncs.h | 2 ++ sdk/include/ndk/kefuncs.h | 3 +++ sdk/include/ndk/section_attribs.h | 41 +++++++++++++++++++++++++++++++++++ win32ss/gdi/eng/ldevobj.h | 1 + win32ss/user/ntuser/main.c | 2 +- win32ss/win32kp.h | 8 ------- 108 files changed, 522 insertions(+), 296 deletions(-) diff --git a/boot/freeldr/freeldr/CMakeLists.txt b/boot/freeldr/freeldr/CMakeLists.txt index 762b53e396..3b5698133c 100644 --- a/boot/freeldr/freeldr/CMakeLists.txt +++ b/boot/freeldr/freeldr/CMakeLists.txt @@ -233,8 +233,8 @@ if(MSVC) add_target_link_flags(freeldr_pe "/ignore:4078 /ignore:4254 /DRIVER") add_target_link_flags(freeldr_pe_dbg "/ignore:4078 /ignore:4254 /DRIVER") else() - add_target_link_flags(freeldr_pe "/ignore:4078 /ignore:4254 /DRIVER /FIXED /ALIGN:0x400 /SECTION:.text,ERW /SECTION:.data,RW /MERGE:.text16=.text /MERGE:.data=.text /MERGE:.rdata=.text /MERGE:.bss=.text") - add_target_link_flags(freeldr_pe_dbg "/ignore:4078 /ignore:4254 /DRIVER /FIXED /ALIGN:0x400 /SECTION:.text,ERW /SECTION:.data,RW /MERGE:.text16=.text /MERGE:.data=.text /MERGE:.rdata=.text /MERGE:.bss=.text") + add_target_link_flags(freeldr_pe "/ignore:4078 /ignore:4254 /DRIVER /FIXED /ALIGN:0x400 /SECTION:.text,ERW /SECTION:.data,RW /MERGE:.text16=.text /MERGE:INIT=.text /MERGE:.data=.text /MERGE:.rdata=.text /MERGE:.bss=.text") + add_target_link_flags(freeldr_pe_dbg "/ignore:4078 /ignore:4254 /DRIVER /FIXED /ALIGN:0x400 /SECTION:.text,ERW /SECTION:.data,RW /MERGE:.text16=.text /MERGE:INIT=.text /MERGE:.data=.text /MERGE:.rdata=.text /MERGE:.bss=.text") endif() else() add_target_link_flags(freeldr_pe "-Wl,--strip-all,--exclude-all-symbols,--file-alignment,0x1000,-T,${CMAKE_CURRENT_SOURCE_DIR}/freeldr_i386.lds") diff --git a/boot/freeldr/freeldr/freeldr_i386.lds b/boot/freeldr/freeldr/freeldr_i386.lds index 36a44ee7ad..5cb2cb6c7b 100644 --- a/boot/freeldr/freeldr/freeldr_i386.lds +++ b/boot/freeldr/freeldr/freeldr_i386.lds @@ -4,6 +4,8 @@ SECTIONS { *(.text) *(SORT(.text*)) + *(INIT) + *(SORT(INIT*)) *(.data) *(SORT(.data*)) *(.rdata) diff --git a/drivers/filesystems/fastfat/fastio.c b/drivers/filesystems/fastfat/fastio.c index 248f39f5bf..428fdbb220 100644 --- a/drivers/filesystems/fastfat/fastio.c +++ b/drivers/filesystems/fastfat/fastio.c @@ -753,7 +753,7 @@ VfatReleaseFromLazyWrite( ExReleaseResourceLite(&(Fcb->MainResource)); } -INIT_SECTION +INIT_FUNCTION VOID VfatInitFastIoRoutines( PFAST_IO_DISPATCH FastIoDispatch) diff --git a/drivers/filesystems/fastfat/iface.c b/drivers/filesystems/fastfat/iface.c index c98e64f02b..f4c6608a3e 100644 --- a/drivers/filesystems/fastfat/iface.c +++ b/drivers/filesystems/fastfat/iface.c @@ -48,7 +48,7 @@ PVFAT_GLOBAL_DATA VfatGlobalData; * RegistryPath = path to our configuration entries * RETURNS: Success or failure */ -INIT_SECTION +INIT_FUNCTION NTSTATUS NTAPI DriverEntry( diff --git a/drivers/filesystems/fastfat/vfat.h b/drivers/filesystems/fastfat/vfat.h index 77b2998dad..48923cdc94 100644 --- a/drivers/filesystems/fastfat/vfat.h +++ b/drivers/filesystems/fastfat/vfat.h @@ -5,17 +5,12 @@ #include <ntdddisk.h> #include <dos.h> #include <pseh/pseh2.h> +#include <section_attribs.h> #ifdef KDBG #include <ndk/kdfuncs.h> #include <reactos/kdros.h> #endif -#ifdef __GNUC__ -#define INIT_SECTION __attribute__((section ("INIT"))) -#else -#define INIT_SECTION /* Done via alloc_text for MSC */ -#endif - #define USE_ROS_CC_AND_FS #define ENABLE_SWAPOUT @@ -823,6 +818,7 @@ VfatSetExtendedAttributes( /* fastio.c */ +INIT_FUNCTION VOID VfatInitFastIoRoutines( PFAST_IO_DISPATCH FastIoDispatch); @@ -1127,6 +1123,7 @@ VfatFileSystemControl( /* iface.c */ +INIT_FUNCTION NTSTATUS NTAPI DriverEntry( diff --git a/drivers/filesystems/mup/dfs.c b/drivers/filesystems/mup/dfs.c index 05371e357b..13a4fe205d 100644 --- a/drivers/filesystems/mup/dfs.c +++ b/drivers/filesystems/mup/dfs.c @@ -82,7 +82,7 @@ DfsUnload(PDRIVER_OBJECT DriverObject) UNIMPLEMENTED; } -INIT_SECTION +INIT_FUNCTION NTSTATUS DfsDriverEntry(PDRIVER_OBJECT DriverObject, PUNICODE_STRING RegistryPath) diff --git a/drivers/filesystems/mup/dfs.h b/drivers/filesystems/mup/dfs.h index 107cb16be5..d158a055ab 100644 --- a/drivers/filesystems/mup/dfs.h +++ b/drivers/filesystems/mup/dfs.h @@ -1,6 +1,15 @@ #ifndef _DFS_PCH_ #define _DFS_PCH_ +#ifndef INIT_SECTION +#ifdef __GNUC__ +#define INIT_SECTION __attribute__((section ("INIT"))) +#else +#define INIT_SECTION /* Done via alloc_text for MSC */ +#endif +#define INIT_FUNCTION INIT_SECTION +#endif + #define DFS_OPEN_CONTEXT 0xFF444653 #define DFS_DOWNLEVEL_OPEN_CONTEXT 0x11444653 #define DFS_CSCAGENT_NAME_CONTEXT 0xAAAAAAAA @@ -49,6 +58,7 @@ DfsUnload( PDRIVER_OBJECT DriverObject ); +INIT_FUNCTION NTSTATUS DfsDriverEntry( PDRIVER_OBJECT DriverObject, diff --git a/drivers/filesystems/mup/mup.c b/drivers/filesystems/mup/mup.c index e8cc8d7e9b..64a277a465 100644 --- a/drivers/filesystems/mup/mup.c +++ b/drivers/filesystems/mup/mup.c @@ -32,6 +32,7 @@ #define NDEBUG #include <debug.h> +INIT_FUNCTION NTSTATUS NTAPI DriverEntry( @@ -39,11 +40,13 @@ DriverEntry( PUNICODE_STRING RegistryPath ); +INIT_FUNCTION VOID MupInitializeData( VOID ); +INIT_FUNCTION VOID MupInitializeVcb( PMUP_VCB Vcb @@ -76,7 +79,7 @@ NTSTATUS MupOrderedErrorList[] = { STATUS_UNSUCCESSFUL, /* FUNCTIONS ****************************************************************/ -INIT_SECTION +INIT_FUNCTION VOID MupInitializeData(VOID) { @@ -102,7 +105,7 @@ MupUninitializeData() ExDeleteResourceLite(&MupVcbLock); } -INIT_SECTION +INIT_FUNCTION VOID MupInitializeVcb(PMUP_VCB Vcb) { @@ -2507,7 +2510,7 @@ MupUnload(PDRIVER_OBJECT DriverObject) * RegistryPath = path to our configuration entries * RETURNS: Success or failure */ -INIT_SECTION +INIT_FUNCTION NTSTATUS NTAPI DriverEntry(PDRIVER_OBJECT DriverObject, diff --git a/drivers/filesystems/mup/mup.h b/drivers/filesystems/mup/mup.h index 810ddc6ec5..ad1aaf549c 100644 --- a/drivers/filesystems/mup/mup.h +++ b/drivers/filesystems/mup/mup.h @@ -5,12 +5,7 @@ #include <ntifs.h> #include <pseh/pseh2.h> #include <ndk/muptypes.h> - -#ifdef __GNUC__ -#define INIT_SECTION __attribute__((section ("INIT"))) -#else -#define INIT_SECTION /* Done via alloc_text for MSC */ -#endif +#include <section_attribs.h> #define ROUND_UP(N, S) ((((N) + (S) - 1) / (S)) * (S)) #define IO_METHOD_FROM_CTL_CODE(C) (C & 0x00000003) diff --git a/drivers/filesystems/ntfs/ntfs.c b/drivers/filesystems/ntfs/ntfs.c index c29badab08..a102439cf9 100644 --- a/drivers/filesystems/ntfs/ntfs.c +++ b/drivers/filesystems/ntfs/ntfs.c @@ -49,7 +49,7 @@ PNTFS_GLOBAL_DATA NtfsGlobalData = NULL; * RegistryPath = path to our configuration entries * RETURNS: Success or failure */ -INIT_SECTION +INIT_FUNCTION NTSTATUS NTAPI DriverEntry(PDRIVER_OBJECT DriverObject, @@ -169,7 +169,7 @@ DriverEntry(PDRIVER_OBJECT DriverObject, * DriverObject = object describing this driver * RETURNS: Nothing */ -INIT_SECTION +INIT_FUNCTION VOID NTAPI NtfsInitializeFunctionPointers(PDRIVER_OBJECT DriverObject) diff --git a/drivers/filesystems/ntfs/ntfs.h b/drivers/filesystems/ntfs/ntfs.h index a0cb6ab7cd..c50a077e1c 100644 --- a/drivers/filesystems/ntfs/ntfs.h +++ b/drivers/filesystems/ntfs/ntfs.h @@ -3,12 +3,7 @@ #include <ntifs.h> #include <pseh/pseh2.h> - -#ifdef __GNUC__ -#define INIT_SECTION __attribute__((section ("INIT"))) -#else -#define INIT_SECTION /* Done via alloc_text for MSC */ -#endif +#include <section_attribs.h> #define CACHEPAGESIZE(pDeviceExt) \ ((pDeviceExt)->NtfsInfo.UCHARsPerCluster > PAGE_SIZE ? \ @@ -1260,8 +1255,10 @@ NtfsSetVolumeInformation(PNTFS_IRP_CONTEXT IrpContext); /* ntfs.c */ +INIT_FUNCTION DRIVER_INITIALIZE DriverEntry; +INIT_FUNCTION VOID NTAPI NtfsInitializeFunctionPointers(PDRIVER_OBJECT DriverObject); diff --git a/hal/halx86/acpi/busemul.c b/hal/halx86/acpi/busemul.c index 87ff519994..d63c89cce5 100644 --- a/hal/halx86/acpi/busemul.c +++ b/hal/halx86/acpi/busemul.c @@ -16,6 +16,7 @@ /* PRIVATE FUNCTIONS **********************************************************/ +INIT_FUNCTION VOID NTAPI HalpRegisterKdSupportFunctions(VOID) diff --git a/hal/halx86/acpi/halacpi.c b/hal/halx86/acpi/halacpi.c index 8b9f204717..7f2779e19c 100644 --- a/hal/halx86/acpi/halacpi.c +++ b/hal/halx86/acpi/halacpi.c @@ -786,6 +786,7 @@ HaliAcpiTimerInit(IN ULONG TimerPort, //HalaAcpiTimerInit(TimerPort, TimerValExt); } +INIT_FUNCTION NTSTATUS NTAPI HalpSetupAcpiPhase0(IN PLOADER_PARAMETER_BLOCK LoaderBlock) @@ -906,6 +907,7 @@ HalpSetupAcpiPhase0(IN PLOADER_PARAMETER_BLOCK LoaderBlock) return STATUS_SUCCESS; } +INIT_FUNCTION VOID NTAPI HalpInitializePciBus(VOID) @@ -927,6 +929,7 @@ HalpInitNonBusHandler(VOID) HalFindBusAddressTranslation = HalpFindBusAddressTranslation; } +INIT_FUNCTION VOID NTAPI HalpInitBusHandlers(VOID) @@ -935,6 +938,7 @@ HalpInitBusHandlers(VOID) HalpInitNonBusHandler(); } +INIT_FUNCTION VOID NTAPI HalpBuildAddressMap(VOID) @@ -942,6 +946,7 @@ HalpBuildAddressMap(VOID) /* ACPI is magic baby */ } +INIT_FUNCTION BOOLEAN NTAPI HalpGetDebugPortTable(VOID) @@ -950,6 +955,7 @@ HalpGetDebugPortTable(VOID) (HalpDebugPortTable->BaseAddress.AddressSpaceID == 1)); } +INIT_FUNCTION ULONG NTAPI HalpIs16BitPortDecodeSupported(VOID) @@ -1059,6 +1065,7 @@ HalpQueryAcpiResourceRequirements(OUT PIO_RESOURCE_REQUIREMENTS_LIST *Requiremen /* * @implemented */ +INIT_FUNCTION VOID NTAPI HalReportResourceUsage(VOID) diff --git a/hal/halx86/apic/rtctimer.c b/hal/halx86/apic/rtctimer.c index b4ffd6c115..afd3d9dab5 100644 --- a/hal/halx86/apic/rtctimer.c +++ b/hal/halx86/apic/rtctimer.c @@ -64,7 +64,7 @@ RtcSetClockRate(UCHAR ClockRate) HalpReleaseCmosSpinLock(); } -INIT_SECTION +INIT_FUNCTION VOID NTAPI HalpInitializeClock(VOID) diff --git a/hal/halx86/generic/cmos.c b/hal/halx86/generic/cmos.c index a8c8d794b4..689883bcc5 100644 --- a/hal/halx86/generic/cmos.c +++ b/hal/halx86/generic/cmos.c @@ -154,7 +154,7 @@ HalpSetCmosData(IN ULONG BusNumber, return Length - Len; } -INIT_SECTION +INIT_FUNCTION VOID NTAPI HalpInitializeCmos(VOID) diff --git a/hal/halx86/generic/dma.c b/hal/halx86/generic/dma.c index 48748c7d5a..7bcfc33e03 100644 --- a/hal/halx86/generic/dma.c +++ b/hal/halx86/generic/dma.c @@ -133,7 +133,7 @@ static DMA_OPERATIONS HalpDmaOperations = { /* FUNCTIONS *****************************************************************/ #ifndef _MINIHAL_ -INIT_SECTION +INIT_FUNCTION VOID HalpInitDma(VOID) { diff --git a/hal/halx86/generic/halinit.c b/hal/halx86/generic/halinit.c index f03038b608..002605deb9 100644 --- a/hal/halx86/generic/halinit.c +++ b/hal/halx86/generic/halinit.c @@ -12,6 +12,7 @@ #define NDEBUG #include <debug.h> +INIT_FUNCTION VOID NTAPI HalpGetParameters( @@ -29,7 +30,7 @@ BOOLEAN HalpPciLockSettings; /* PRIVATE FUNCTIONS *********************************************************/ -INIT_SECTION +INIT_FUNCTION VOID NTAPI HalpGetParameters(IN PLOADER_PARAMETER_BLOCK LoaderBlock) @@ -76,7 +77,7 @@ HalInitializeProcessor( /* * @implemented */ -INIT_SECTION +INIT_FUNCTION BOOLEAN NTAPI HalInitSystem(IN ULONG BootPhase, diff --git a/hal/halx86/generic/misc.c b/hal/halx86/generic/misc.c index b1ca888802..866b459106 100644 --- a/hal/halx86/generic/misc.c +++ b/hal/halx86/generic/misc.c @@ -27,7 +27,7 @@ CHAR HalpSerialNumber[31]; /* PRIVATE FUNCTIONS **********************************************************/ #ifndef _MINIHAL_ -INIT_SECTION +INIT_FUNCTION VOID NTAPI HalpReportSerialNumber(VOID) @@ -58,7 +58,7 @@ HalpReportSerialNumber(VOID) } } -INIT_SECTION +INIT_FUNCTION NTSTATUS NTAPI HalpMarkAcpiHal(VOID) diff --git a/hal/halx86/generic/timer.c b/hal/halx86/generic/timer.c index 3b3f77803e..35606b96ec 100644 --- a/hal/halx86/generic/timer.c +++ b/hal/halx86/generic/timer.c @@ -111,7 +111,7 @@ HalpSetTimerRollOver(USHORT RollOver) __writeeflags(Flags); } -INIT_SECTION +INIT_FUNCTION VOID NTAPI HalpInitializeClock(VOID) diff --git a/hal/halx86/generic/usage.c b/hal/halx86/generic/usage.c index 725aa42357..5f94fee5f5 100644 --- a/hal/halx86/generic/usage.c +++ b/hal/halx86/generic/usage.c @@ -12,6 +12,7 @@ #define NDEBUG #include <debug.h> +INIT_FUNCTION VOID NTAPI HalpGetResourceSortValue( @@ -20,6 +21,7 @@ HalpGetResourceSortValue( OUT PLARGE_INTEGER Value ); +INIT_FUNCTION VOID NTAPI HalpBuildPartialFromIdt( @@ -28,6 +30,7 @@ HalpBuildPartialFromIdt( IN PCM_PARTIAL_RESOURCE_DESCRIPTOR TranslatedDescriptor ); +INIT_FUNCTION VOID NTAPI HalpBuildPartialFromAddress( @@ -97,7 +100,7 @@ ADDRESS_USAGE HalpDefaultIoSpace = /* FUNCTIONS ******************************************************************/ #ifndef _MINIHAL_ -INIT_SECTION +INIT_FUNCTION VOID NTAPI HalpGetResourceSortValue(IN PCM_PARTIAL_RESOURCE_DESCRIPTOR Descriptor, @@ -137,7 +140,7 @@ HalpGetResourceSortValue(IN PCM_PARTIAL_RESOURCE_DESCRIPTOR Descriptor, } } -INIT_SECTION +INIT_FUNCTION VOID NTAPI HalpBuildPartialFromIdt(IN ULONG Entry, @@ -175,7 +178,7 @@ HalpBuildPartialFromIdt(IN ULONG Entry, TranslatedDescriptor->u.Interrupt.Level = HalpIDTUsage[Entry].Irql; } -INIT_SECTION +INIT_FUNCTION VOID NTAPI HalpBuildPartialFromAddress(IN INTERFACE_TYPE Interface, @@ -243,7 +246,7 @@ HalpBuildPartialFromAddress(IN INTERFACE_TYPE Interface, } } -INIT_SECTION +INIT_FUNCTION VOID NTAPI HalpReportResourceUsage(IN PUNICODE_STRING HalName, @@ -522,7 +525,7 @@ HalpReportResourceUsage(IN PUNICODE_STRING HalName, } #endif -INIT_SECTION +INIT_FUNCTION VOID NTAPI HalpRegisterVector(IN UCHAR Flags, @@ -539,7 +542,7 @@ HalpRegisterVector(IN UCHAR Flags, } #ifndef _MINIHAL_ -INIT_SECTION +INIT_FUNCTION VOID NTAPI HalpEnableInterruptHandler(IN UCHAR Flags, @@ -562,7 +565,7 @@ HalpEnableInterruptHandler(IN UCHAR Flags, HalEnableSystemInterrupt(SystemVector, Irql, Mode); } -INIT_SECTION +INIT_FUNCTION VOID NTAPI HalpGetNMICrashFlag(VOID) diff --git a/hal/halx86/include/bus.h b/hal/halx86/include/bus.h index 56d3e5507f..755595c3ae 100644 --- a/hal/halx86/include/bus.h +++ b/hal/halx86/include/bus.h @@ -282,6 +282,7 @@ extern PCI_CONFIG_HANDLER PCIConfigHandler; extern PCI_CONFIG_HANDLER PCIConfigHandlerType1; extern PCI_CONFIG_HANDLER PCIConfigHandlerType2; +INIT_FUNCTION PPCI_REGISTRY_INFO_INTERNAL NTAPI HalpQueryPciRegistryInfo( @@ -425,12 +426,14 @@ HalpSetCmosData( IN ULONG Length ); +INIT_FUNCTION VOID NTAPI HalpInitializePciBus( VOID ); +INIT_FUNCTION VOID NTAPI HalpInitializePciStubs( @@ -470,6 +473,7 @@ HalpFindBusAddressTranslation( IN BOOLEAN NextBus ); +INIT_FUNCTION VOID NTAPI HalpRegisterPciDebuggingDeviceInfo( @@ -606,6 +610,7 @@ HalpTranslateIsaBusAddress( OUT PPHYSICAL_ADDRESS TranslatedAddress ); +INIT_FUNCTION ULONG NTAPI HalpGetSystemInterruptVector( diff --git a/hal/halx86/include/halacpi.h b/hal/halx86/include/halacpi.h index 8f51fdf369..a4a68f6793 100644 --- a/hal/halx86/include/halacpi.h +++ b/hal/halx86/include/halacpi.h @@ -24,6 +24,7 @@ HalpAcpiGetTable( IN ULONG Signature ); +INIT_FUNCTION NTSTATUS NTAPI HalpSetupAcpiPhase0( diff --git a/hal/halx86/include/halp.h b/hal/halx86/include/halp.h index a8e935ff9b..190bfe8463 100644 --- a/hal/halx86/include/halp.h +++ b/hal/halx86/include/halp.h @@ -4,13 +4,6 @@ #pragma once -#if defined(__GNUC__) && !defined(_MINIHAL_) -#define INIT_SECTION __attribute__((section ("INIT"))) -#else -#define INIT_SECTION /* Done via alloc_text for MSC */ -#endif - - #ifdef CONFIG_SMP #define HAL_BUILD_TYPE (DBG ? PRCB_BUILD_DEBUG : 0) #else @@ -556,6 +549,7 @@ typedef struct _HalAddressUsage PADAPTER_OBJECT NTAPI HalpAllocateAdapterEx(ULONG NumberOfMapRegisters,BOOLEAN IsMaster, BOOLEAN Dma32BitAddresses); /* sysinfo.c */ +INIT_FUNCTION VOID NTAPI HalpRegisterVector(IN UCHAR Flags, @@ -563,6 +557,7 @@ HalpRegisterVector(IN UCHAR Flags, IN ULONG SystemVector, IN KIRQL Irql); +INIT_FUNCTION VOID NTAPI HalpEnableInterruptHandler(IN UCHAR Flags, @@ -584,7 +579,7 @@ DECLSPEC_NORETURN VOID FASTCALL HalpDispatchInterrupt2ndEntry(IN PKTRAP_FRAME Tr extern BOOLEAN HalpProfilingStopped; /* timer.c */ -VOID NTAPI HalpInitializeClock(VOID); +INIT_FUNCTION VOID NTAPI HalpInitializeClock(VOID); VOID __cdecl HalpClockInterrupt(VOID); VOID __cdecl HalpProfileInterrupt(VOID); @@ -596,7 +591,7 @@ HalpCalibrateStallExecution(VOID); VOID HalpInitPciBus (VOID); /* dma.c */ -VOID HalpInitDma (VOID); +INIT_FUNCTION VOID HalpInitDma (VOID); /* Non-generic initialization */ VOID HalpInitPhase0 (PLOADER_PARAMETER_BLOCK LoaderBlock); @@ -615,12 +610,14 @@ HalpCheckPowerButton( VOID ); +INIT_FUNCTION VOID NTAPI HalpRegisterKdSupportFunctions( VOID ); +INIT_FUNCTION NTSTATUS NTAPI HalpSetupPciDeviceForDebugging( @@ -628,6 +625,7 @@ HalpSetupPciDeviceForDebugging( IN OUT PDEBUG_DEVICE_DESCRIPTOR PciDevice ); +INIT_FUNCTION NTSTATUS NTAPI HalpReleasePciDeviceForDebugging( @@ -727,6 +725,7 @@ HaliHaltSystem( // // CMOS Routines // +INIT_FUNCTION VOID NTAPI HalpInitializeCmos( @@ -777,36 +776,42 @@ HalpOpenRegistryKey( IN BOOLEAN Create ); +INIT_FUNCTION VOID NTAPI HalpGetNMICrashFlag( VOID ); +INIT_FUNCTION BOOLEAN NTAPI HalpGetDebugPortTable( VOID ); +INIT_FUNCTION VOID NTAPI HalpReportSerialNumber( VOID ); +INIT_FUNCTION NTSTATUS NTAPI HalpMarkAcpiHal( VOID ); +INIT_FUNCTION VOID NTAPI HalpBuildAddressMap( VOID ); +INIT_FUNCTION VOID NTAPI HalpReportResourceUsage( @@ -814,6 +819,7 @@ HalpReportResourceUsage( IN INTERFACE_TYPE InterfaceType ); +INIT_FUNCTION ULONG NTAPI HalpIs16BitPortDecodeSupported( @@ -834,6 +840,7 @@ KeUpdateSystemTime( IN KIRQL OldIrql ); +INIT_FUNCTION VOID NTAPI HalpInitBusHandlers( @@ -846,6 +853,7 @@ HaliInitPnpDriver( VOID ); +INIT_FUNCTION VOID NTAPI HalpDebugPciDumpBus( diff --git a/hal/halx86/legacy/bus/pcibus.c b/hal/halx86/legacy/bus/pcibus.c index 4f363ad379..c06f0bafec 100644 --- a/hal/halx86/legacy/bus/pcibus.c +++ b/hal/halx86/legacy/bus/pcibus.c @@ -608,7 +608,7 @@ HalpGetISAFixedPCIIrq(IN PBUS_HANDLER BusHandler, return STATUS_SUCCESS; } -INIT_SECTION +INIT_FUNCTION NTSTATUS NTAPI HalpSetupPciDeviceForDebugging(IN PVOID LoaderBlock, @@ -618,7 +618,7 @@ HalpSetupPciDeviceForDebugging(IN PVOID LoaderBlock, return STATUS_NOT_IMPLEMENTED; } -INIT_SECTION +INIT_FUNCTION NTSTATUS NTAPI HalpReleasePciDeviceForDebugging(IN OUT PDEBUG_DEVICE_DESCRIPTOR PciDevice) @@ -627,7 +627,7 @@ HalpReleasePciDeviceForDebugging(IN OUT PDEBUG_DEVICE_DESCRIPTOR PciDevice) return STATUS_NOT_IMPLEMENTED; } -INIT_SECTION +INIT_FUNCTION VOID NTAPI HalpRegisterPciDebuggingDeviceInfo(VOID) @@ -862,7 +862,7 @@ HaliPciInterfaceReadConfig(IN PBUS_HANDLER RootBusHandler, return Length; } -INIT_SECTION +INIT_FUNCTION PPCI_REGISTRY_INFO_INTERNAL NTAPI HalpQueryPciRegistryInfo(VOID) @@ -1095,7 +1095,7 @@ HalpQueryPciRegistryInfo(VOID) #endif } -INIT_SECTION +INIT_FUNCTION VOID NTAPI HalpInitializePciStubs(VOID) diff --git a/hal/halx86/legacy/bus/sysbus.c b/hal/halx86/legacy/bus/sysbus.c index fccb823398..ec2019dfd6 100644 --- a/hal/halx86/legacy/bus/sysbus.c +++ b/hal/halx86/legacy/bus/sysbus.c @@ -139,6 +139,7 @@ HalpGetRootInterruptVector(IN ULONG BusInterruptLevel, return SystemVector; } +INIT_FUNCTION ULONG NTAPI HalpGetSystemInterruptVector(IN PBUS_HANDLER BusHandler, diff --git a/hal/halx86/legacy/bussupp.c b/hal/halx86/legacy/bussupp.c index 4d20396560..7fff59f235 100644 --- a/hal/halx86/legacy/bussupp.c +++ b/hal/halx86/legacy/bussupp.c @@ -12,6 +12,7 @@ #define NDEBUG #include <debug.h> +INIT_FUNCTION PBUS_HANDLER NTAPI HalpAllocateAndInitPciBusHandler( @@ -20,12 +21,14 @@ HalpAllocateAndInitPciBusHandler( IN BOOLEAN TestAllocation ); +INIT_FUNCTION VOID NTAPI HalpFixupPciSupportedRanges( IN ULONG BusCount ); +INIT_FUNCTION NTSTATUS NTAPI HalpGetChipHacks( @@ -35,6 +38,7 @@ HalpGetChipHacks( IN PULONG HackFlags ); +INIT_FUNCTION BOOLEAN NTAPI HalpGetPciBridgeConfig( @@ -42,18 +46,21 @@ HalpGetPciBridgeConfig( IN PUCHAR BusCount ); +INIT_FUNCTION BOOLEAN NTAPI HalpIsBridgeDevice( IN PPCI_COMMON_CONFIG PciData ); +INIT_FUNCTION BOOLEAN NTAPI HalpIsIdeDevice( IN PPCI_COMMON_CONFIG PciData ); +INIT_FUNCTION BOOLEAN NTAPI HalpIsRecognizedCard( @@ -62,6 +69,7 @@ HalpIsRecognizedCard( IN ULONG Flags ); +INIT_FUNCTION BOOLEAN NTAPI HalpIsValidPCIDevice( @@ -69,18 +77,21 @@ HalpIsValidPCIDevice( IN PCI_SLOT_NUMBER Slot ); +INIT_FUNCTION NTSTATUS NTAPI HalpMarkChipsetDecode( IN BOOLEAN OverrideEnable ); +INIT_FUNCTION VOID NTAPI HalpRegisterInternalBusHandlers( VOID ); +INIT_FUNCTION VOID NTAPI ShowSize( @@ -160,7 +171,7 @@ HalpAllocateBusHandler(IN INTERFACE_TYPE InterfaceType, return Bus; } -INIT_SECTION +INIT_FUNCTION VOID NTAPI HalpRegisterInternalBusHandlers(VOID) @@ -235,7 +246,7 @@ HalpRegisterInternalBusHandlers(VOID) } #ifndef _MINIHAL_ -INIT_SECTION +INIT_FUNCTION NTSTATUS NTAPI HalpMarkChipsetDecode(BOOLEAN OverrideEnable) @@ -283,7 +294,7 @@ HalpMarkChipsetDecode(BOOLEAN OverrideEnable) return Status; } -INIT_SECTION +INIT_FUNCTION PBUS_HANDLER NTAPI HalpAllocateAndInitPciBusHandler(IN ULONG PciType, @@ -368,7 +379,7 @@ HalpAllocateAndInitPciBusHandler(IN ULONG PciType, return Bus; } -INIT_SECTION +INIT_FUNCTION BOOLEAN NTAPI HalpIsValidPCIDevice(IN PBUS_HANDLER BusHandler, @@ -430,7 +441,7 @@ HalpIsValidPCIDevice(IN PBUS_HANDLER BusHandler, static BOOLEAN WarningsGiven[5]; -INIT_SECTION +INIT_FUNCTION NTSTATUS NTAPI HalpGetChipHacks(IN USHORT VendorId, @@ -494,7 +505,7 @@ HalpGetChipHacks(IN USHORT VendorId, return Status; } -INIT_SECTION +INIT_FUNCTION BOOLEAN NTAPI HalpIsRecognizedCard(IN PPCI_REGISTRY_INFO_INTERNAL PciRegistryInfo, @@ -575,7 +586,7 @@ HalpIsRecognizedCard(IN PPCI_REGISTRY_INFO_INTERNAL PciRegistryInfo, return FALSE; } -INIT_SECTION +INIT_FUNCTION BOOLEAN NTAPI HalpIsIdeDevice(IN PPCI_COMMON_CONFIG PciData) @@ -628,7 +639,7 @@ HalpIsIdeDevice(IN PPCI_COMMON_CONFIG PciData) return FALSE; } -INIT_SECTION +INIT_FUNCTION BOOLEAN NTAPI HalpIsBridgeDevice(IN PPCI_COMMON_CONFIG PciData) @@ -642,7 +653,7 @@ HalpIsBridgeDevice(IN PPCI_COMMON_CONFIG PciData) (PciData->SubClass == PCI_SUBCLASS_BR_CARDBUS))); } -INIT_SECTION +INIT_FUNCTION BOOLEAN NTAPI HalpGetPciBridgeConfig(IN ULONG PciType, @@ -695,7 +706,7 @@ HalpGetPciBridgeConfig(IN ULONG PciType, return FALSE; } -INIT_SECTION +INIT_FUNCTION VOID NTAPI HalpFixupPciSupportedRanges(IN ULONG BusCount) @@ -758,7 +769,7 @@ HalpFixupPciSupportedRanges(IN ULONG BusCount) } } -INIT_SECTION +INIT_FUNCTION VOID NTAPI ShowSize(ULONG x) @@ -790,7 +801,7 @@ ShowSize(ULONG x) */ #include "pci_classes.h" #include "pci_vendors.h" -INIT_SECTION +INIT_FUNCTION VOID NTAPI HalpDebugPciDumpBus(IN ULONG i, @@ -943,7 +954,7 @@ HalpDebugPciDumpBus(IN ULONG i, } #endif -INIT_SECTION +INIT_FUNCTION VOID NTAPI HalpInitializePciBus(VOID) @@ -1182,7 +1193,7 @@ HalpInitializePciBus(VOID) #endif } -INIT_SECTION +INIT_FUNCTION VOID NTAPI HalpInitBusHandlers(VOID) @@ -1191,7 +1202,7 @@ HalpInitBusHandlers(VOID) HalpRegisterInternalBusHandlers(); } -INIT_SECTION +INIT_FUNCTION VOID NTAPI HalpRegisterKdSupportFunctions(VOID) diff --git a/hal/halx86/legacy/halpcat.c b/hal/halx86/legacy/halpcat.c index b8d7fa657e..d097ca7c72 100644 --- a/hal/halx86/legacy/halpcat.c +++ b/hal/halx86/legacy/halpcat.c @@ -30,7 +30,7 @@ PWCHAR HalName = L"PC Compatible Eisa/Isa HAL"; /* PRIVATE FUNCTIONS **********************************************************/ -INIT_SECTION +INIT_FUNCTION NTSTATUS NTAPI HalpSetupAcpiPhase0(IN PLOADER_PARAMETER_BLOCK LoaderBlock) @@ -39,7 +39,7 @@ HalpSetupAcpiPhase0(IN PLOADER_PARAMETER_BLOCK LoaderBlock) return STATUS_NO_SUCH_DEVICE; } -INIT_SECTION +INIT_FUNCTION VOID NTAPI HalpBuildAddressMap(VOID) @@ -51,7 +51,7 @@ HalpBuildAddressMap(VOID) //HalpAddROMRanges(); } -INIT_SECTION +INIT_FUNCTION BOOLEAN NTAPI HalpGetDebugPortTable(VOID) @@ -60,7 +60,7 @@ HalpGetDebugPortTable(VOID) return FALSE; } -INIT_SECTION +INIT_FUNCTION ULONG NTAPI HalpIs16BitPortDecodeSupported(VOID) @@ -70,7 +70,7 @@ HalpIs16BitPortDecodeSupported(VOID) } #if 0 -INIT_SECTION +INIT_FUNCTION NTSTATUS NTAPI HaliInitPnpDriver(VOID) @@ -84,7 +84,7 @@ HaliInitPnpDriver(VOID) /* * @implemented */ -INIT_SECTION +INIT_FUNCTION VOID NTAPI HalReportResourceUsage(VOID) diff --git a/hal/halx86/up/halinit_mini.c b/hal/halx86/up/halinit_mini.c index ae0f6cde30..505a23a93e 100644 --- a/hal/halx86/up/halinit_mini.c +++ b/hal/halx86/up/halinit_mini.c @@ -34,6 +34,7 @@ HalpInitPhase1(VOID) { } +INIT_FUNCTION NTSTATUS NTAPI HalpSetupAcpiPhase0(IN PLOADER_PARAMETER_BLOCK LoaderBlock) diff --git a/ntoskrnl/cache/newcc.h b/ntoskrnl/cache/newcc.h index adbf1c5d92..a668c52328 100644 --- a/ntoskrnl/cache/newcc.h +++ b/ntoskrnl/cache/newcc.h @@ -38,6 +38,7 @@ typedef struct _NOCC_CACHE_MAP ULONG ReadAheadGranularity; } NOCC_CACHE_MAP, *PNOCC_CACHE_MAP; +INIT_FUNCTION VOID NTAPI CcPfInitializePrefetcher(VOID); @@ -53,6 +54,7 @@ CcMdlWriteComplete2(IN PFILE_OBJECT FileObject, IN PLARGE_INTEGER FileOffset, IN PMDL MdlChain); +INIT_FUNCTION VOID NTAPI CcInitView(VOID); @@ -62,6 +64,7 @@ NTAPI CcpUnpinData(PNOCC_BCB Bcb, BOOLEAN ActuallyRelease); +INIT_FUNCTION BOOLEAN NTAPI CcInitializeCacheManager(VOID); diff --git a/ntoskrnl/cc/cacheman.c b/ntoskrnl/cc/cacheman.c index 8ccd6a703d..9c7bf43298 100644 --- a/ntoskrnl/cc/cacheman.c +++ b/ntoskrnl/cc/cacheman.c @@ -22,9 +22,9 @@ static ULONG BugCheckFileId = 0x4 << 16; /* FUNCTIONS *****************************************************************/ +INIT_FUNCTION VOID NTAPI -INIT_FUNCTION CcPfInitializePrefetcher(VOID) { /* Notify debugger */ @@ -40,9 +40,9 @@ CcPfInitializePrefetcher(VOID) /* FIXME: Setup the rest of the prefetecher */ } +INIT_FUNCTION BOOLEAN NTAPI -INIT_FUNCTION CcInitializeCacheManager(VOID) { ULONG Thread; diff --git a/ntoskrnl/config/cmalloc.c b/ntoskrnl/config/cmalloc.c index 621a265223..2c2868ea7c 100644 --- a/ntoskrnl/config/cmalloc.c +++ b/ntoskrnl/config/cmalloc.c @@ -23,9 +23,9 @@ LIST_ENTRY CmpFreeDelayItemsListHead; /* FUNCTIONS *****************************************************************/ +INIT_FUNCTION VOID NTAPI -INIT_FUNCTION CmpInitCmPrivateAlloc(VOID) { /* Make sure we didn't already do this */ @@ -38,9 +38,9 @@ CmpInitCmPrivateAlloc(VOID) } } +INIT_FUNCTION VOID NTAPI -INIT_FUNCTION CmpInitCmPrivateDelayAlloc(VOID) { /* Initialize the delay allocation list and lock */ diff --git a/ntoskrnl/config/cmboot.c b/ntoskrnl/config/cmboot.c index 73f6d0ac9f..f1790284fc 100644 --- a/ntoskrnl/config/cmboot.c +++ b/ntoskrnl/config/cmboot.c @@ -19,9 +19,9 @@ extern ULONG InitSafeBootMode; /* FUNCTIONS ******************************************************************/ +INIT_FUNCTION HCELL_INDEX NTAPI -INIT_FUNCTION CmpFindControlSet(IN PHHIVE SystemHive, IN HCELL_INDEX RootCell, IN PUNICODE_STRING SelectKeyName, @@ -129,9 +129,9 @@ CmpFindControlSet(IN PHHIVE SystemHive, return ControlSetCell; } +INIT_FUNCTION ULONG NTAPI -INIT_FUNCTION CmpFindTagIndex(IN PHHIVE Hive, IN HCELL_INDEX TagCell, IN HCELL_INDEX GroupOrderCell, @@ -179,9 +179,9 @@ CmpFindTagIndex(IN PHHIVE Hive, return -2; } +INIT_FUNCTION BOOLEAN NTAPI -INIT_FUNCTION CmpAddDriverToList(IN PHHIVE Hive, IN HCELL_INDEX DriverCell, IN HCELL_INDEX GroupOrderCell, @@ -346,9 +346,9 @@ CmpAddDriverToList(IN PHHIVE Hive, return TRUE; } +INIT_FUNCTION BOOLEAN NTAPI -INIT_FUNCTION CmpIsLoadType(IN PHHIVE Hive, IN HCELL_INDEX Cell, IN SERVICE_LOAD_TYPE LoadType) @@ -377,9 +377,9 @@ CmpIsLoadType(IN PHHIVE Hive, return (*Data == LoadType); } +INIT_FUNCTION BOOLEAN NTAPI -INIT_FUNCTION CmpFindDrivers(IN PHHIVE Hive, IN HCELL_INDEX ControlSet, IN SERVICE_LOAD_TYPE LoadType, @@ -499,9 +499,9 @@ CmpFindDrivers(IN PHHIVE Hive, return TRUE; } +INIT_FUNCTION BOOLEAN NTAPI -INIT_FUNCTION CmpDoSort(IN PLIST_ENTRY DriverListHead, IN PUNICODE_STRING OrderList) { @@ -556,9 +556,9 @@ CmpDoSort(IN PLIST_ENTRY DriverListHead, return TRUE; } +INIT_FUNCTION BOOLEAN NTAPI -INIT_FUNCTION CmpSortDriverList(IN PHHIVE Hive, IN HCELL_INDEX ControlSet, IN PLIST_ENTRY DriverListHead) @@ -605,9 +605,9 @@ CmpSortDriverList(IN PHHIVE Hive, return CmpDoSort(DriverListHead, &DependList); } +INIT_FUNCTION BOOLEAN NTAPI -INIT_FUNCTION CmpOrderGroup(IN PBOOT_DRIVER_NODE StartNode, IN PBOOT_DRIVER_NODE EndNode) { @@ -668,9 +668,9 @@ CmpOrderGroup(IN PBOOT_DRIVER_NODE StartNode, return TRUE; } +INIT_FUNCTION BOOLEAN NTAPI -INIT_FUNCTION CmpResolveDriverDependencies(IN PLIST_ENTRY DriverListHead) { PLIST_ENTRY NextEntry; @@ -718,9 +718,9 @@ CmpResolveDriverDependencies(IN PLIST_ENTRY DriverListHead) return TRUE; } +INIT_FUNCTION BOOLEAN NTAPI -INIT_FUNCTION CmpIsSafe(IN PHHIVE Hive, IN HCELL_INDEX SafeBootCell, IN HCELL_INDEX DriverCell) diff --git a/ntoskrnl/config/cmconfig.c b/ntoskrnl/config/cmconfig.c index 97b81d682e..be46cfeb2c 100644 --- a/ntoskrnl/config/cmconfig.c +++ b/ntoskrnl/config/cmconfig.c @@ -14,9 +14,9 @@ /* FUNCTIONS *****************************************************************/ +INIT_FUNCTION NTSTATUS NTAPI -INIT_FUNCTION CmpInitializeRegistryNode(IN PCONFIGURATION_COMPONENT_DATA CurrentEntry, IN HANDLE NodeHandle, OUT PHANDLE NewHandle, @@ -199,9 +199,9 @@ CmpInitializeRegistryNode(IN PCONFIGURATION_COMPONENT_DATA CurrentEntry, return Status; } +INIT_FUNCTION NTSTATUS NTAPI -INIT_FUNCTION CmpSetupConfigurationTree(IN PCONFIGURATION_COMPONENT_DATA CurrentEntry, IN HANDLE ParentHandle, IN INTERFACE_TYPE InterfaceType, @@ -322,9 +322,9 @@ CmpSetupConfigurationTree(IN PCONFIGURATION_COMPONENT_DATA CurrentEntry, return STATUS_SUCCESS; } +INIT_FUNCTION NTSTATUS NTAPI -INIT_FUNCTION CmpInitializeHardwareConfiguration(IN PLOADER_PARAMETER_BLOCK LoaderBlock) { NTSTATUS Status; diff --git a/ntoskrnl/config/cmcontrl.c b/ntoskrnl/config/cmcontrl.c index 54d4949979..935d55bf30 100644 --- a/ntoskrnl/config/cmcontrl.c +++ b/ntoskrnl/config/cmcontrl.c @@ -16,9 +16,9 @@ /* FUNCTIONS *****************************************************************/ +INIT_FUNCTION LANGID NTAPI -INIT_FUNCTION CmpConvertLangId(IN LPWSTR Name, IN ULONG NameLength) { @@ -67,9 +67,9 @@ CmpConvertLangId(IN LPWSTR Name, return LangId; } +INIT_FUNCTION HCELL_INDEX NTAPI -INIT_FUNCTION CmpWalkPath(IN PHHIVE SystemHive, IN HCELL_INDEX ParentCell, IN LPWSTR Path) @@ -98,9 +98,9 @@ CmpWalkPath(IN PHHIVE SystemHive, } } +INIT_FUNCTION VOID NTAPI -INIT_FUNCTION CmGetSystemControlValues(IN PVOID SystemHiveData, IN PCM_SYSTEM_CONTROL_VECTOR ControlVector) { diff --git a/ntoskrnl/config/cmdata.c b/ntoskrnl/config/cmdata.c index a32909da34..77d82616de 100644 --- a/ntoskrnl/config/cmdata.c +++ b/ntoskrnl/config/cmdata.c @@ -65,7 +65,7 @@ ULONG CmpTypeCount[MaximumType + 1]; HANDLE CmpRegistryRootHandle; -INIT_FUNCTION UNICODE_STRING CmClassName[MaximumClass + 1] = +INIT_SECTION UNICODE_STRING CmClassName[MaximumClass + 1] = { RTL_CONSTANT_STRING(L"System"), RTL_CONSTANT_STRING(L"Processor"), @@ -77,7 +77,7 @@ INIT_FUNCTION UNICODE_STRING CmClassName[MaximumClass + 1] = RTL_CONSTANT_STRING(L"Undefined") }; -INIT_FUNCTION UNICODE_STRING CmTypeName[MaximumType + 1] = +INIT_SECTION UNICODE_STRING CmTypeName[MaximumType + 1] = { RTL_CONSTANT_STRING(L"System"), RTL_CONSTANT_STRING(L"CentralProcessor"), @@ -123,7 +123,7 @@ INIT_FUNCTION UNICODE_STRING CmTypeName[MaximumType + 1] = RTL_CONSTANT_STRING(L"Undefined") }; -INIT_FUNCTION CMP_MF_TYPE CmpMultifunctionTypes[] = +INIT_SECTION CMP_MF_TYPE CmpMultifunctionTypes[] = { {"ISA", Isa, 0}, {"MCA", MicroChannel, 0}, @@ -136,7 +136,7 @@ INIT_FUNCTION CMP_MF_TYPE CmpMultifunctionTypes[] = {NULL, Internal, 0} }; -INIT_FUNCTION CM_SYSTEM_CONTROL_VECTOR CmControlVector[] = +INIT_SECTION CM_SYSTEM_CONTROL_VECTOR CmControlVector[] = { { L"Session Manager", diff --git a/ntoskrnl/config/cmdelay.c b/ntoskrnl/config/cmdelay.c index e0c487d90c..34321eaba3 100644 --- a/ntoskrnl/config/cmdelay.c +++ b/ntoskrnl/config/cmdelay.c @@ -185,9 +185,9 @@ CmpDelayCloseWorker(IN PVOID Context) CmpUnlockRegistry(); } +INIT_FUNCTION VOID NTAPI -INIT_FUNCTION CmpInitializeDelayedCloseTable(VOID) { @@ -262,9 +262,9 @@ CmpDelayDerefKCBWorker(IN PVOID Context) CmpUnlockRegistry(); } +INIT_FUNCTION VOID NTAPI -INIT_FUNCTION CmpInitDelayDerefKCBEngine(VOID) { /* Initialize lock and list */ diff --git a/ntoskrnl/config/cmhook.c b/ntoskrnl/config/cmhook.c index 7f8acdf4cb..1ba3c5bbbd 100644 --- a/ntoskrnl/config/cmhook.c +++ b/ntoskrnl/config/cmhook.c @@ -32,9 +32,9 @@ typedef struct _REGISTRY_CALLBACK /* PRIVATE FUNCTIONS *********************************************************/ +INIT_FUNCTION VOID NTAPI -INIT_FUNCTION CmpInitCallback(VOID) { ULONG i; diff --git a/ntoskrnl/config/cmkcbncb.c b/ntoskrnl/config/cmkcbncb.c index 8751357e8b..d9b0941e12 100644 --- a/ntoskrnl/config/cmkcbncb.c +++ b/ntoskrnl/config/cmkcbncb.c @@ -20,9 +20,9 @@ PCM_NAME_HASH_TABLE_ENTRY CmpNameCacheTable; /* FUNCTIONS *****************************************************************/ +INIT_FUNCTION VOID NTAPI -INIT_FUNCTION CmpInitializeCache(VOID) { ULONG Length, i; diff --git a/ntoskrnl/config/cmsysini.c b/ntoskrnl/config/cmsysini.c index 295e4b4376..d672ead8c2 100644 --- a/ntoskrnl/config/cmsysini.c +++ b/ntoskrnl/config/cmsysini.c @@ -391,9 +391,9 @@ CmpInitHiveFromFile(IN PCUNICODE_STRING HiveName, return STATUS_SUCCESS; } +INIT_FUNCTION NTSTATUS NTAPI -INIT_FUNCTION CmpSetSystemValues(IN PLOADER_PARAMETER_BLOCK LoaderBlock) { NTSTATUS Status; @@ -446,9 +446,9 @@ Quit: return Status; } +INIT_FUNCTION static NTSTATUS -INIT_FUNCTION CmpCreateHardwareProfile(HANDLE ControlSetHandle) { OBJECT_ATTRIBUTES ObjectAttributes; @@ -518,9 +518,9 @@ done: return Status; } +INIT_FUNCTION NTSTATUS NTAPI -INIT_FUNCTION CmpCreateControlSet(IN PLOADER_PARAMETER_BLOCK LoaderBlock) { UNICODE_STRING ConfigName = RTL_CONSTANT_STRING(L"Control\\IDConfigDB"); @@ -859,9 +859,9 @@ CmpLinkHiveToMaster(IN PUNICODE_STRING LinkName, return STATUS_SUCCESS; } +INIT_FUNCTION BOOLEAN NTAPI -INIT_FUNCTION CmpInitializeSystemHive(IN PLOADER_PARAMETER_BLOCK LoaderBlock) { static const UNICODE_STRING HiveName = RTL_CONSTANT_STRING(L"SYSTEM"); @@ -976,9 +976,9 @@ CmpInitializeSystemHive(IN PLOADER_PARAMETER_BLOCK LoaderBlock) return TRUE; } +INIT_FUNCTION NTSTATUS NTAPI -INIT_FUNCTION CmpCreateObjectTypes(VOID) { OBJECT_TYPE_INITIALIZER ObjectTypeInitializer; @@ -1010,9 +1010,9 @@ CmpCreateObjectTypes(VOID) return ObCreateObjectType(&Name, &ObjectTypeInitializer, NULL, &CmpKeyObjectType); } +INIT_FUNCTION BOOLEAN NTAPI -INIT_FUNCTION CmpCreateRootNode(IN PHHIVE Hive, IN PCWSTR Name, OUT PHCELL_INDEX Index) @@ -1066,9 +1066,9 @@ CmpCreateRootNode(IN PHHIVE Hive, return TRUE; } +INIT_FUNCTION BOOLEAN NTAPI -INIT_FUNCTION CmpCreateRegistryRoot(VOID) { UNICODE_STRING KeyName; @@ -1511,9 +1511,9 @@ CmpInitializeHiveList(VOID) CmpNoVolatileCreates = TRUE; } +INIT_FUNCTION BOOLEAN NTAPI -INIT_FUNCTION CmInitSystem1(VOID) { OBJECT_ATTRIBUTES ObjectAttributes; @@ -1727,9 +1727,9 @@ CmInitSystem1(VOID) return TRUE; } +INIT_FUNCTION VOID NTAPI -INIT_FUNCTION CmpFreeDriverList(IN PHHIVE Hive, IN PLIST_ENTRY DriverList) { @@ -1776,9 +1776,9 @@ CmpFreeDriverList(IN PHHIVE Hive, } } +INIT_FUNCTION PUNICODE_STRING* NTAPI -INIT_FUNCTION CmGetSystemDriverList(VOID) { LIST_ENTRY DriverList; diff --git a/ntoskrnl/ex/handle.c b/ntoskrnl/ex/handle.c index 5c26ccdca8..a0ea5fb448 100644 --- a/ntoskrnl/ex/handle.c +++ b/ntoskrnl/ex/handle.c @@ -22,9 +22,9 @@ EX_PUSH_LOCK HandleTableListLock; /* PRIVATE FUNCTIONS *********************************************************/ +INIT_FUNCTION VOID NTAPI -INIT_FUNCTION ExpInitializeHandleTables(VOID) { /* Initialize the list of handle tables and the lock */ diff --git a/ntoskrnl/ex/hdlsterm.c b/ntoskrnl/ex/hdlsterm.c index ffd6b0afb2..3b8dc13ea6 100644 --- a/ntoskrnl/ex/hdlsterm.c +++ b/ntoskrnl/ex/hdlsterm.c @@ -183,9 +183,9 @@ HdlspEnableTerminal(IN BOOLEAN Enable) return STATUS_SUCCESS; } +INIT_FUNCTION VOID NTAPI -INIT_FUNCTION HeadlessInit(IN PLOADER_PARAMETER_BLOCK LoaderBlock) { PHEADLESS_LOADER_BLOCK HeadlessBlock; diff --git a/ntoskrnl/ex/init.c b/ntoskrnl/ex/init.c index 66819c56c8..10be805374 100644 --- a/ntoskrnl/ex/init.c +++ b/ntoskrnl/ex/init.c @@ -91,9 +91,9 @@ BOOLEAN ExpRealTimeIsUniversal; /* FUNCTIONS ****************************************************************/ +INIT_FUNCTION NTSTATUS NTAPI -INIT_FUNCTION ExpCreateSystemRootLink(IN PLOADER_PARAMETER_BLOCK LoaderBlock) { UNICODE_STRING LinkName; @@ -203,9 +203,9 @@ ExpCreateSystemRootLink(IN PLOADER_PARAMETER_BLOCK LoaderBlock) return STATUS_SUCCESS; } +INIT_FUNCTION VOID NTAPI -INIT_FUNCTION ExpInitNls(IN PLOADER_PARAMETER_BLOCK LoaderBlock) { LARGE_INTEGER SectionSize; @@ -379,9 +379,9 @@ ExpInitNls(IN PLOADER_PARAMETER_BLOCK LoaderBlock) ExpNlsTableBase = SectionBase; } +INIT_FUNCTION VOID NTAPI -INIT_FUNCTION ExpLoadInitialProcess(IN PINIT_BUFFER InitBuffer, OUT PRTL_USER_PROCESS_PARAMETERS *ProcessParameters, OUT PCHAR *ProcessEnvironment) @@ -596,9 +596,9 @@ ExpLoadInitialProcess(IN PINIT_BUFFER InitBuffer, *ProcessEnvironment = EnvironmentPtr; } +INIT_FUNCTION ULONG NTAPI -INIT_FUNCTION ExComputeTickCountMultiplier(IN ULONG ClockIncrement) { ULONG MsRemainder = 0, MsIncrement; @@ -629,9 +629,9 @@ ExComputeTickCountMultiplier(IN ULONG ClockIncrement) return (MsIncrement << 24) | MsRemainder; } +INIT_FUNCTION BOOLEAN NTAPI -INIT_FUNCTION ExpInitSystemPhase0(VOID) { /* Initialize EXRESOURCE Support */ @@ -652,9 +652,9 @@ ExpInitSystemPhase0(VOID) return TRUE; } +INIT_FUNCTION BOOLEAN NTAPI -INIT_FUNCTION ExpInitSystemPhase1(VOID) { /* Initialize worker threads */ @@ -729,9 +729,9 @@ ExpInitSystemPhase1(VOID) return TRUE; } +INIT_FUNCTION BOOLEAN NTAPI -INIT_FUNCTION ExInitSystem(VOID) { /* Check the initialization phase */ @@ -755,9 +755,9 @@ ExInitSystem(VOID) } } +INIT_FUNCTION BOOLEAN NTAPI -INIT_FUNCTION ExpIsLoaderValid(IN PLOADER_PARAMETER_BLOCK LoaderBlock) { PLOADER_PARAMETER_EXTENSION Extension; @@ -781,9 +781,9 @@ ExpIsLoaderValid(IN PLOADER_PARAMETER_BLOCK LoaderBlock) return TRUE; } +INIT_FUNCTION VOID NTAPI -INIT_FUNCTION ExpLoadBootSymbols(IN PLOADER_PARAMETER_BLOCK LoaderBlock) { ULONG i = 0; @@ -862,9 +862,9 @@ ExpLoadBootSymbols(IN PLOADER_PARAMETER_BLOCK LoaderBlock) } } +INIT_FUNCTION VOID NTAPI -INIT_FUNCTION ExBurnMemory(IN PLOADER_PARAMETER_BLOCK LoaderBlock, IN ULONG_PTR PagesToDestroy, IN TYPE_OF_MEMORY MemoryType) @@ -908,9 +908,9 @@ ExBurnMemory(IN PLOADER_PARAMETER_BLOCK LoaderBlock, } } +INIT_FUNCTION VOID NTAPI -INIT_FUNCTION ExpInitializeExecutive(IN ULONG Cpu, IN PLOADER_PARAMETER_BLOCK LoaderBlock) { @@ -1327,9 +1327,9 @@ VOID NTAPI MmFreeLoaderBlock(IN PLOADER_PARAMETER_BLOCK LoaderBlock); +INIT_FUNCTION VOID NTAPI -INIT_FUNCTION Phase1InitializationDiscard(IN PVOID Context) { PLOADER_PARAMETER_BLOCK LoaderBlock = Context; diff --git a/ntoskrnl/ex/lookas.c b/ntoskrnl/ex/lookas.c index ceb3789f9c..376d94baf3 100644 --- a/ntoskrnl/ex/lookas.c +++ b/ntoskrnl/ex/lookas.c @@ -29,9 +29,9 @@ GENERAL_LOOKASIDE ExpSmallPagedPoolLookasideLists[MAXIMUM_PROCESSORS]; /* PRIVATE FUNCTIONS *********************************************************/ +INIT_FUNCTION VOID NTAPI -INIT_FUNCTION ExInitializeSystemLookasideList(IN PGENERAL_LOOKASIDE List, IN POOL_TYPE Type, IN ULONG Size, @@ -57,9 +57,9 @@ ExInitializeSystemLookasideList(IN PGENERAL_LOOKASIDE List, List->LastAllocateHits = 0; } +INIT_FUNCTION VOID NTAPI -INIT_FUNCTION ExInitPoolLookasidePointers(VOID) { ULONG i; @@ -87,9 +87,9 @@ ExInitPoolLookasidePointers(VOID) } } +INIT_FUNCTION VOID NTAPI -INIT_FUNCTION ExpInitLookasideLists(VOID) { ULONG i; diff --git a/ntoskrnl/ex/pushlock.c b/ntoskrnl/ex/pushlock.c index 9ac77a11aa..855231393a 100644 --- a/ntoskrnl/ex/pushlock.c +++ b/ntoskrnl/ex/pushlock.c @@ -39,9 +39,9 @@ ULONG ExPushLockSpinCount = 0; * @remarks The ExpInitializePushLocks routine sets up the spin on SMP machines. * *--*/ +INIT_FUNCTION VOID NTAPI -INIT_FUNCTION ExpInitializePushLocks(VOID) { #ifdef CONFIG_SMP diff --git a/ntoskrnl/ex/resource.c b/ntoskrnl/ex/resource.c index 1911ef1813..192f8702e3 100644 --- a/ntoskrnl/ex/resource.c +++ b/ntoskrnl/ex/resource.c @@ -163,9 +163,9 @@ ExpCheckForApcsDisabled(IN KIRQL Irql, * @remarks This routine should only be called once, during system startup. * *--*/ +INIT_FUNCTION VOID NTAPI -INIT_FUNCTION ExpResourceInitialization(VOID) { /* Setup the timeout */ diff --git a/ntoskrnl/ex/xipdisp.c b/ntoskrnl/ex/xipdisp.c index 1fe7725097..669a706f77 100644 --- a/ntoskrnl/ex/xipdisp.c +++ b/ntoskrnl/ex/xipdisp.c @@ -25,9 +25,9 @@ XIPDispatch(IN ULONG DispatchCode, return STATUS_NOT_IMPLEMENTED; } +INIT_FUNCTION PMEMORY_ALLOCATION_DESCRIPTOR NTAPI -INIT_FUNCTION XIPpFindMemoryDescriptor(IN PLOADER_PARAMETER_BLOCK LoaderBlock) { PLIST_ENTRY NextEntry; @@ -49,9 +49,9 @@ XIPpFindMemoryDescriptor(IN PLOADER_PARAMETER_BLOCK LoaderBlock) return NULL; } +INIT_FUNCTION VOID NTAPI -INIT_FUNCTION XIPInit(IN PLOADER_PARAMETER_BLOCK LoaderBlock) { PCHAR CommandLine, XipBoot, XipRom, XipMegs, XipVerbose, XipRam; diff --git a/ntoskrnl/fsrtl/fsrtlpc.c b/ntoskrnl/fsrtl/fsrtlpc.c index 1a97085d79..30d0b46d83 100644 --- a/ntoskrnl/fsrtl/fsrtlpc.c +++ b/ntoskrnl/fsrtl/fsrtlpc.c @@ -16,7 +16,7 @@ PERESOURCE FsRtlPagingIoResources; ULONG FsRtlPagingIoResourceSelector; -NTSTATUS NTAPI INIT_FUNCTION FsRtlInitializeWorkerThread(VOID); +INIT_FUNCTION NTSTATUS NTAPI FsRtlInitializeWorkerThread(VOID); extern KSEMAPHORE FsRtlpUncSemaphore; static const UCHAR LegalAnsiCharacterArray[] = @@ -155,9 +155,9 @@ const UCHAR * const FsRtlLegalAnsiCharacterArray = LegalAnsiCharacterArray; /* PRIVATE FUNCTIONS *********************************************************/ +INIT_FUNCTION BOOLEAN NTAPI -INIT_FUNCTION FsRtlInitSystem(VOID) { ULONG i; diff --git a/ntoskrnl/fsrtl/stackovf.c b/ntoskrnl/fsrtl/stackovf.c index 353e893aa7..c5dda39f7a 100644 --- a/ntoskrnl/fsrtl/stackovf.c +++ b/ntoskrnl/fsrtl/stackovf.c @@ -144,9 +144,9 @@ FsRtlWorkerThread(IN PVOID StartContext) /* * @implemented */ +INIT_FUNCTION NTSTATUS NTAPI -INIT_FUNCTION FsRtlInitializeWorkerThread(VOID) { ULONG_PTR i; diff --git a/ntoskrnl/inbv/inbv.c b/ntoskrnl/inbv/inbv.c index 9228569298..c1ece52461 100644 --- a/ntoskrnl/inbv/inbv.c +++ b/ntoskrnl/inbv/inbv.c @@ -212,9 +212,9 @@ BootLogoFadeIn(VOID) /* FUNCTIONS *****************************************************************/ +INIT_FUNCTION PVOID NTAPI -INIT_FUNCTION FindBitmapResource(IN PLOADER_PARAMETER_BLOCK LoaderBlock, IN ULONG ResourceId) { @@ -277,9 +277,9 @@ FindBitmapResource(IN PLOADER_PARAMETER_BLOCK LoaderBlock, return Data; } +INIT_FUNCTION BOOLEAN NTAPI -INIT_FUNCTION InbvDriverInitialize(IN PLOADER_PARAMETER_BLOCK LoaderBlock, IN ULONG Count) { @@ -357,9 +357,9 @@ InbvReleaseLock(VOID) if (InbvOldIrql <= DISPATCH_LEVEL) KeLowerIrql(OldIrql); } +INIT_FUNCTION VOID NTAPI -INIT_FUNCTION InbvEnableBootDriver(IN BOOLEAN Enable) { /* Check if we're installed */ @@ -622,9 +622,9 @@ InbvSolidColorFill(IN ULONG Left, } } +INIT_FUNCTION VOID NTAPI -INIT_FUNCTION InbvUpdateProgressBar(IN ULONG Progress) { ULONG FillCount, BoundedProgress; @@ -738,9 +738,9 @@ InbvSetProgressBarSubset(IN ULONG Floor, InbvProgressState.Bias = (Ceiling * 100) - Floor; } +INIT_FUNCTION VOID NTAPI -INIT_FUNCTION InbvIndicateProgress(VOID) { ULONG Percentage; @@ -930,9 +930,9 @@ InbvRotationThread( PsTerminateSystemThread(STATUS_SUCCESS); } +INIT_FUNCTION VOID NTAPI -INIT_FUNCTION InbvRotBarInit(VOID) { PltRotBarStatus = RBS_FADEIN; @@ -940,9 +940,9 @@ InbvRotBarInit(VOID) } #endif +INIT_FUNCTION VOID NTAPI -INIT_FUNCTION DisplayBootBitmap(IN BOOLEAN TextMode) { PVOID Header = NULL, Footer = NULL, Screen = NULL; @@ -1185,9 +1185,9 @@ DisplayBootBitmap(IN BOOLEAN TextMode) #endif } +INIT_FUNCTION VOID NTAPI -INIT_FUNCTION DisplayFilter(PCHAR *String) { /* Windows hack to skip first dots */ @@ -1209,9 +1209,9 @@ DisplayFilter(PCHAR *String) } } +INIT_FUNCTION VOID NTAPI -INIT_FUNCTION FinalizeBootLogo(VOID) { /* Acquire lock and check the display state */ diff --git a/ntoskrnl/include/internal/amd64/mm.h b/ntoskrnl/include/internal/amd64/mm.h index f788094458..8f881a12c2 100644 --- a/ntoskrnl/include/internal/amd64/mm.h +++ b/ntoskrnl/include/internal/amd64/mm.h @@ -289,6 +289,7 @@ MI_IS_MAPPED_PTE(PMMPTE PointerPte) return ((PointerPte->u.Long & 0xFFFFFC01) != 0); } +INIT_FUNCTION VOID FORCEINLINE MmInitGlobalKernelPageDirectory(VOID) diff --git a/ntoskrnl/include/internal/cc.h b/ntoskrnl/include/internal/cc.h index 10bdb43a86..332ad524c4 100644 --- a/ntoskrnl/include/internal/cc.h +++ b/ntoskrnl/include/internal/cc.h @@ -288,6 +288,7 @@ extern LAZY_WRITER LazyWriter; #define NODE_TYPE_PRIVATE_MAP 0x02FE #define NODE_TYPE_SHARED_MAP 0x02FF +INIT_FUNCTION VOID NTAPI CcPfInitializePrefetcher( @@ -324,6 +325,7 @@ CcRosGetVacb( PROS_VACB *Vacb ); +INIT_FUNCTION VOID NTAPI CcInitView(VOID); @@ -340,6 +342,7 @@ NTSTATUS NTAPI CcWriteVirtualAddress(PROS_VACB Vacb); +INIT_FUNCTION BOOLEAN NTAPI CcInitializeCacheManager(VOID); diff --git a/ntoskrnl/include/internal/cm.h b/ntoskrnl/include/internal/cm.h index 76fc5b9d1a..a65e5e8ba2 100644 --- a/ntoskrnl/include/internal/cm.h +++ b/ntoskrnl/include/internal/cm.h @@ -694,6 +694,7 @@ CmpFlushNotify( IN BOOLEAN LockHeld ); +INIT_FUNCTION VOID NTAPI CmpInitCallback( @@ -703,24 +704,28 @@ CmpInitCallback( // // KCB Cache/Delay Routines // +INIT_FUNCTION VOID NTAPI CmpInitializeCache( VOID ); +INIT_FUNCTION VOID NTAPI CmpInitCmPrivateDelayAlloc( VOID ); +INIT_FUNCTION VOID NTAPI CmpInitCmPrivateAlloc( VOID ); +INIT_FUNCTION VOID NTAPI CmpInitDelayDerefKCBEngine( @@ -963,6 +968,7 @@ VOID NTAPI CmpRemoveFromDelayedClose(IN PCM_KEY_CONTROL_BLOCK Kcb); +INIT_FUNCTION VOID NTAPI CmpInitializeDelayedCloseTable( @@ -1161,6 +1167,7 @@ CmpCreateLinkNode( // // Boot Routines // +INIT_FUNCTION HCELL_INDEX NTAPI CmpFindControlSet( @@ -1170,6 +1177,7 @@ CmpFindControlSet( OUT PBOOLEAN AutoSelect ); +INIT_FUNCTION VOID NTAPI CmGetSystemControlValues( @@ -1186,6 +1194,7 @@ CmpSaveBootControlSet( // // Hardware Configuration Routines // +INIT_FUNCTION NTSTATUS NTAPI CmpInitializeRegistryNode( @@ -1203,6 +1212,7 @@ CmpInitializeMachineDependentConfiguration( IN PLOADER_PARAMETER_BLOCK LoaderBlock ); +INIT_FUNCTION NTSTATUS NTAPI CmpInitializeHardwareConfiguration( @@ -1407,6 +1417,7 @@ CmSaveMergedKeys( // // Startup and Shutdown // +INIT_FUNCTION BOOLEAN NTAPI CmInitSystem1( @@ -1434,12 +1445,14 @@ CmpSetVersionData( // // Driver List Routines // +INIT_FUNCTION PUNICODE_STRING* NTAPI CmGetSystemDriverList( VOID ); +INIT_FUNCTION BOOLEAN NTAPI CmpFindDrivers( @@ -1450,7 +1463,7 @@ CmpFindDrivers( IN PLIST_ENTRY DriverListHead ); - +INIT_FUNCTION BOOLEAN NTAPI CmpSortDriverList( @@ -1459,12 +1472,14 @@ CmpSortDriverList( IN PLIST_ENTRY DriverListHead ); +INIT_FUNCTION BOOLEAN NTAPI CmpResolveDriverDependencies( IN PLIST_ENTRY DriverListHead ); +INIT_FUNCTION BOOLEAN NTAPI CmpIsSafe( diff --git a/ntoskrnl/include/internal/dbgk.h b/ntoskrnl/include/internal/dbgk.h index 96cbb1f309..ef49aebbc5 100644 --- a/ntoskrnl/include/internal/dbgk.h +++ b/ntoskrnl/include/internal/dbgk.h @@ -46,6 +46,7 @@ #define DBGKTRACE(x, fmt, ...) DPRINT(fmt, ##__VA_ARGS__) #endif +INIT_FUNCTION VOID NTAPI DbgkInitialize( diff --git a/ntoskrnl/include/internal/ex.h b/ntoskrnl/include/internal/ex.h index 89fec75914..2eaf8d2da0 100644 --- a/ntoskrnl/include/internal/ex.h +++ b/ntoskrnl/include/internal/ex.h @@ -169,6 +169,7 @@ ExGetPoolTagInfo( /* INITIALIZATION FUNCTIONS *************************************************/ +INIT_FUNCTION BOOLEAN NTAPI ExpWin32kInit(VOID); @@ -183,6 +184,7 @@ Phase1Initialization( IN PVOID Context ); +INIT_FUNCTION VOID NTAPI ExpInitializePushLocks(VOID); @@ -193,6 +195,7 @@ ExRefreshTimeZoneInformation( IN PLARGE_INTEGER SystemBootTime ); +INIT_FUNCTION VOID NTAPI ExpInitializeWorkerThreads(VOID); @@ -201,10 +204,12 @@ VOID NTAPI ExSwapinWorkerThreads(IN BOOLEAN AllowSwap); +INIT_FUNCTION VOID NTAPI ExpInitLookasideLists(VOID); +INIT_FUNCTION VOID NTAPI ExInitializeSystemLookasideList( @@ -216,14 +221,17 @@ ExInitializeSystemLookasideList( IN PLIST_ENTRY ListHead ); +INIT_FUNCTION BOOLEAN NTAPI ExpInitializeCallbacks(VOID); +INIT_FUNCTION VOID NTAPI ExpInitUuids(VOID); +INIT_FUNCTION VOID NTAPI ExpInitializeExecutive( @@ -235,38 +243,47 @@ VOID NTAPI ExShutdownSystem(VOID); +INIT_FUNCTION BOOLEAN NTAPI ExpInitializeEventImplementation(VOID); +INIT_FUNCTION BOOLEAN NTAPI ExpInitializeKeyedEventImplementation(VOID); +INIT_FUNCTION BOOLEAN NTAPI ExpInitializeEventPairImplementation(VOID); +INIT_FUNCTION BOOLEAN NTAPI ExpInitializeSemaphoreImplementation(VOID); +INIT_FUNCTION BOOLEAN NTAPI ExpInitializeMutantImplementation(VOID); +INIT_FUNCTION BOOLEAN NTAPI ExpInitializeTimerImplementation(VOID); +INIT_FUNCTION BOOLEAN NTAPI ExpInitializeProfileImplementation(VOID); +INIT_FUNCTION VOID NTAPI ExpResourceInitialization(VOID); +INIT_FUNCTION VOID NTAPI ExInitPoolLookasidePointers(VOID); @@ -406,6 +423,7 @@ typedef BOOLEAN ULONG_PTR Context ); +INIT_FUNCTION VOID NTAPI ExpInitializeHandleTables( @@ -1461,12 +1479,14 @@ ExTimerRundown( VOID ); +INIT_FUNCTION VOID NTAPI HeadlessInit( IN PLOADER_PARAMETER_BLOCK LoaderBlock ); +INIT_FUNCTION VOID NTAPI XIPInit( diff --git a/ntoskrnl/include/internal/fsrtl.h b/ntoskrnl/include/internal/fsrtl.h index 6e65bd7888..67464d4abb 100644 --- a/ntoskrnl/include/internal/fsrtl.h +++ b/ntoskrnl/include/internal/fsrtl.h @@ -108,12 +108,14 @@ typedef struct _INT_MAPPING // // Initialization Routines // +INIT_FUNCTION VOID NTAPI FsRtlInitializeLargeMcbs( VOID ); +INIT_FUNCTION VOID NTAPI FsRtlInitializeTunnels( @@ -129,6 +131,7 @@ FsRtlPTeardownPerFileObjectContexts( IN PFILE_OBJECT FileObject ); +INIT_FUNCTION BOOLEAN NTAPI FsRtlInitSystem( diff --git a/ntoskrnl/include/internal/i386/ke.h b/ntoskrnl/include/internal/i386/ke.h index c7c48eaf5f..10eb6eb1be 100644 --- a/ntoskrnl/include/internal/i386/ke.h +++ b/ntoskrnl/include/internal/i386/ke.h @@ -321,6 +321,7 @@ KiSetTebBase(PKPCR Pcr, PVOID TebAddress) Ke386SetGdtEntryBase(&Pcr->GDT[KGDT_R3_TEB / sizeof(KGDTENTRY)], TebAddress); } +INIT_FUNCTION VOID FASTCALL Ki386InitializeTss( @@ -329,30 +330,36 @@ Ki386InitializeTss( IN PKGDTENTRY Gdt ); +INIT_FUNCTION VOID NTAPI KiSetCR0Bits(VOID); +INIT_FUNCTION VOID NTAPI KiGetCacheInformation(VOID); +INIT_FUNCTION BOOLEAN NTAPI KiIsNpxPresent( VOID ); +INIT_FUNCTION BOOLEAN NTAPI KiIsNpxErrataPresent( VOID ); +INIT_FUNCTION VOID NTAPI KiSetProcessorType(VOID); +INIT_FUNCTION ULONG NTAPI KiGetFeatureBits(VOID); @@ -387,18 +394,21 @@ Ki386SetupAndExitToV86Mode( OUT PTEB VdmTeb ); +INIT_FUNCTION VOID NTAPI KeI386VdmInitialize( VOID ); +INIT_FUNCTION ULONG_PTR NTAPI Ki386EnableGlobalPage( IN ULONG_PTR Context ); +INIT_FUNCTION ULONG_PTR NTAPI Ki386EnableTargetLargePage( @@ -426,48 +436,56 @@ Ki386EnableCurrentLargePage( IN ULONG Cr3 ); +INIT_FUNCTION VOID NTAPI KiI386PentiumLockErrataFixup( VOID ); +INIT_FUNCTION VOID NTAPI KiInitializePAT( VOID ); +INIT_FUNCTION VOID NTAPI KiInitializeMTRR( IN BOOLEAN FinalCpu ); +INIT_FUNCTION VOID NTAPI KiAmdK6InitializeMTRR( VOID ); +INIT_FUNCTION VOID NTAPI KiRestoreFastSyscallReturnState( VOID ); +INIT_FUNCTION ULONG_PTR NTAPI Ki386EnableDE( IN ULONG_PTR Context ); +INIT_FUNCTION ULONG_PTR NTAPI Ki386EnableFxsr( IN ULONG_PTR Context ); +INIT_FUNCTION ULONG_PTR NTAPI Ki386EnableXMMIExceptions( @@ -791,11 +809,12 @@ KiCheckForApcDelivery(IN PKTRAP_FRAME TrapFrame) // // Switches from boot loader to initial kernel stack // +INIT_FUNCTION FORCEINLINE VOID KiSwitchToBootStack(IN ULONG_PTR InitialStack) { - VOID NTAPI KiSystemStartupBootStack(VOID); + INIT_FUNCTION VOID NTAPI KiSystemStartupBootStack(VOID); /* We have to switch to a new stack before continuing kernel initialization */ #ifdef __GNUC__ diff --git a/ntoskrnl/include/internal/inbv.h b/ntoskrnl/include/internal/inbv.h index 92de2cc83b..3fb6669a58 100644 --- a/ntoskrnl/include/internal/inbv.h +++ b/ntoskrnl/include/internal/inbv.h @@ -21,18 +21,21 @@ typedef enum _ROT_BAR_TYPE RB_PROGRESS_BAR } ROT_BAR_TYPE; +INIT_FUNCTION VOID NTAPI InbvUpdateProgressBar( IN ULONG Progress ); +INIT_FUNCTION VOID NTAPI InbvRotBarInit( VOID ); +INIT_FUNCTION BOOLEAN NTAPI InbvDriverInitialize( @@ -40,24 +43,28 @@ InbvDriverInitialize( IN ULONG Count ); +INIT_FUNCTION VOID NTAPI InbvEnableBootDriver( IN BOOLEAN Enable ); +INIT_FUNCTION VOID NTAPI DisplayBootBitmap( IN BOOLEAN TextMode ); +INIT_FUNCTION VOID NTAPI DisplayFilter( IN PCHAR *String ); +INIT_FUNCTION VOID NTAPI FinalizeBootLogo( @@ -78,6 +85,7 @@ InbvBitBlt( IN ULONG Y ); +INIT_FUNCTION VOID NTAPI InbvIndicateProgress( diff --git a/ntoskrnl/include/internal/io.h b/ntoskrnl/include/internal/io.h index 8ae32a0dc5..7e93ca8856 100644 --- a/ntoskrnl/include/internal/io.h +++ b/ntoskrnl/include/internal/io.h @@ -577,6 +577,7 @@ PipCallDriverAddDevice( IN PDRIVER_OBJECT DriverObject ); +INIT_FUNCTION NTSTATUS NTAPI IopInitializePlugPlayServices( @@ -692,6 +693,7 @@ IoDestroyDriverList( VOID ); +INIT_FUNCTION NTSTATUS IopInitPlugPlayEvents(VOID); @@ -740,12 +742,14 @@ IopTraverseDeviceTree( // // PnP Routines // +INIT_FUNCTION NTSTATUS NTAPI IopUpdateRootKey( VOID ); +INIT_FUNCTION NTSTATUS NTAPI PiInitCacheGroupInformation( @@ -783,12 +787,14 @@ PnpRegSzToString( // // Initialization Routines // +INIT_FUNCTION NTSTATUS NTAPI IopCreateArcNames( IN PLOADER_PARAMETER_BLOCK LoaderBlock ); +INIT_FUNCTION NTSTATUS NTAPI IopReassignSystemRoot( @@ -796,6 +802,7 @@ IopReassignSystemRoot( OUT PANSI_STRING NtBootPath ); +INIT_FUNCTION BOOLEAN NTAPI IoInitSystem( @@ -986,11 +993,13 @@ IopShutdownBaseFileSystems( // // Boot logging support // +INIT_FUNCTION VOID IopInitBootLog( IN BOOLEAN StartBootLog ); +INIT_FUNCTION VOID IopStartBootLog( VOID @@ -1062,6 +1071,7 @@ RawFsIsRawFileSystemDeviceObject( IN PDEVICE_OBJECT DeviceObject ); +INIT_FUNCTION NTSTATUS NTAPI RawFsDriverEntry( @@ -1094,12 +1104,14 @@ PnpRootRegisterDevice( // // Driver Routines // +INIT_FUNCTION VOID FASTCALL IopInitializeBootDrivers( VOID ); +INIT_FUNCTION VOID FASTCALL IopInitializeSystemDrivers( @@ -1356,6 +1368,7 @@ IoSetIoCompletion( // // Ramdisk Routines // +INIT_FUNCTION NTSTATUS NTAPI IopStartRamdisk( diff --git a/ntoskrnl/include/internal/ke.h b/ntoskrnl/include/internal/ke.h index 7bdd97fd8e..1abde8fff6 100644 --- a/ntoskrnl/include/internal/ke.h +++ b/ntoskrnl/include/internal/ke.h @@ -724,10 +724,12 @@ KeQueryValuesProcess(IN PKPROCESS Process, /* INITIALIZATION FUNCTIONS *************************************************/ +INIT_FUNCTION BOOLEAN NTAPI KeInitSystem(VOID); +INIT_FUNCTION VOID NTAPI KeInitExceptions(VOID); @@ -736,10 +738,12 @@ VOID NTAPI KeInitInterrupts(VOID); +INIT_FUNCTION VOID NTAPI KiInitializeBugCheck(VOID); +INIT_FUNCTION VOID NTAPI KiSystemStartup( @@ -900,6 +904,7 @@ KiChainedDispatch( IN PKINTERRUPT Interrupt ); +INIT_FUNCTION VOID NTAPI KiInitializeMachineType( @@ -917,6 +922,7 @@ KiSetupStackAndInitializeKernel( IN PLOADER_PARAMETER_BLOCK LoaderBlock ); +INIT_FUNCTION VOID NTAPI KiInitSpinLocks( @@ -924,6 +930,7 @@ KiInitSpinLocks( IN CCHAR Number ); +INIT_FUNCTION LARGE_INTEGER NTAPI KiComputeReciprocal( @@ -931,6 +938,7 @@ KiComputeReciprocal( OUT PUCHAR Shift ); +INIT_FUNCTION VOID NTAPI KiInitSystem( @@ -959,6 +967,7 @@ KiCallbackReturn( IN NTSTATUS Status ); +INIT_FUNCTION VOID NTAPI KiInitMachineDependent(VOID); diff --git a/ntoskrnl/include/internal/lpc.h b/ntoskrnl/include/internal/lpc.h index e862a4f247..667309ebdd 100644 --- a/ntoskrnl/include/internal/lpc.h +++ b/ntoskrnl/include/internal/lpc.h @@ -137,6 +137,7 @@ LpcExitThread( // // Initialization functions // +INIT_FUNCTION BOOLEAN NTAPI LpcInitSystem( diff --git a/ntoskrnl/include/internal/mm.h b/ntoskrnl/include/internal/mm.h index cf9e5069ac..b4d7ad85bc 100644 --- a/ntoskrnl/include/internal/mm.h +++ b/ntoskrnl/include/internal/mm.h @@ -559,6 +559,7 @@ MiCheckAllProcessMemoryAreas(VOID); /* npool.c *******************************************************************/ +INIT_FUNCTION VOID NTAPI MiInitializeNonPagedPool(VOID); @@ -609,6 +610,7 @@ MmInit1( VOID ); +INIT_FUNCTION BOOLEAN NTAPI MmInitSystem(IN ULONG Phase, @@ -625,6 +627,7 @@ VOID NTAPI MmFreeSwapPage(SWAPENTRY Entry); +INIT_FUNCTION VOID NTAPI MmInitPagingFile(VOID); @@ -793,6 +796,7 @@ MmDeleteKernelStack(PVOID Stack, /* balace.c ******************************************************************/ +INIT_FUNCTION VOID NTAPI MmInitializeMemoryConsumer( @@ -800,6 +804,7 @@ MmInitializeMemoryConsumer( NTSTATUS (*Trim)(ULONG Target, ULONG Priority, PULONG NrFreed) ); +INIT_FUNCTION VOID NTAPI MmInitializeBalancer( @@ -822,6 +827,7 @@ MmRequestPageMemoryConsumer( PPFN_NUMBER AllocatedPage ); +INIT_FUNCTION VOID NTAPI MiInitBalancerThread(VOID); @@ -867,6 +873,7 @@ MmDeleteRmap( PVOID Address ); +INIT_FUNCTION VOID NTAPI MmInitializeRmapList(VOID); @@ -1076,6 +1083,7 @@ MmIsDisabledPage( PVOID Address ); +INIT_FUNCTION VOID NTAPI MmInitGlobalKernelPageDirectory(VOID); @@ -1178,6 +1186,7 @@ MmCreateProcessAddressSpace( IN PULONG_PTR DirectoryTableBase ); +INIT_FUNCTION NTSTATUS NTAPI MmInitializeHandBuiltProcess( @@ -1185,7 +1194,7 @@ MmInitializeHandBuiltProcess( IN PULONG_PTR DirectoryTableBase ); - +INIT_FUNCTION NTSTATUS NTAPI MmInitializeHandBuiltProcess2( @@ -1305,6 +1314,7 @@ MmProtectSectionView( PULONG OldProtect ); +INIT_FUNCTION NTSTATUS NTAPI MmInitSectionImplementation(VOID); @@ -1327,6 +1337,7 @@ MmPageOutSectionView( ULONG_PTR Entry ); +INIT_FUNCTION NTSTATUS NTAPI MmCreatePhysicalMemorySection(VOID); @@ -1345,12 +1356,14 @@ MmFreeSectionSegments(PFILE_OBJECT FileObject); /* sysldr.c ******************************************************************/ +INIT_FUNCTION VOID NTAPI MiReloadBootLoadedDrivers( IN PLOADER_PARAMETER_BLOCK LoaderBlock ); +INIT_FUNCTION BOOLEAN NTAPI MiInitializeLoadedModuleList( diff --git a/ntoskrnl/include/internal/ntoskrnl.h b/ntoskrnl/include/internal/ntoskrnl.h index eb7b92fb8e..c16a4b5ad2 100644 --- a/ntoskrnl/include/internal/ntoskrnl.h +++ b/ntoskrnl/include/internal/ntoskrnl.h @@ -1,15 +1,6 @@ #pragma once -/* - * Use these to place a function in a specific section of the executable - */ -#ifdef __GNUC__ -#define INIT_SECTION __attribute__((section ("INIT"))) -#define INIT_FUNCTION INIT_SECTION -#else -#define INIT_SECTION /* Done via alloc_text for MSC */ -#define INIT_FUNCTION INIT_SECTION -#endif +#include <section_attribs.h> diff --git a/ntoskrnl/include/internal/ob.h b/ntoskrnl/include/internal/ob.h index 1026c49ee7..355e9339d8 100644 --- a/ntoskrnl/include/internal/ob.h +++ b/ntoskrnl/include/internal/ob.h @@ -159,6 +159,7 @@ typedef struct _OB_TEMP_BUFFER // // Startup and Shutdown Functions // +INIT_FUNCTION BOOLEAN NTAPI ObInitSystem( @@ -421,6 +422,7 @@ ObInheritDeviceMap( IN PEPROCESS Process ); +INIT_FUNCTION NTSTATUS NTAPI ObpCreateDosDevicesDirectory( @@ -430,6 +432,7 @@ ObpCreateDosDevicesDirectory( // // Security descriptor cache functions // +INIT_FUNCTION NTSTATUS NTAPI ObpInitSdCache( diff --git a/ntoskrnl/include/internal/po.h b/ntoskrnl/include/internal/po.h index 1fe2940721..f9d57e3e59 100644 --- a/ntoskrnl/include/internal/po.h +++ b/ntoskrnl/include/internal/po.h @@ -264,12 +264,14 @@ typedef struct _POP_SHUTDOWN_WAIT_ENTRY // // Initialization routines // +INIT_FUNCTION BOOLEAN NTAPI PoInitSystem( IN ULONG BootPhase ); +INIT_FUNCTION VOID NTAPI PoInitializePrcb( diff --git a/ntoskrnl/include/internal/ps.h b/ntoskrnl/include/internal/ps.h index b6eb06d250..fd360cfa33 100644 --- a/ntoskrnl/include/internal/ps.h +++ b/ntoskrnl/include/internal/ps.h @@ -90,6 +90,7 @@ PspShutdownProcessManager( VOID ); +INIT_FUNCTION BOOLEAN NTAPI PsInitSystem( @@ -120,6 +121,7 @@ PspMapSystemDll( IN BOOLEAN UseLargePages ); +INIT_FUNCTION NTSTATUS NTAPI PsLocateSystemDll( @@ -352,6 +354,7 @@ PspRemoveProcessFromJob( IN PEJOB Job ); +INIT_FUNCTION VOID NTAPI PspInitializeJobStructures( @@ -415,6 +418,7 @@ PspIsProcessExiting(IN PEPROCESS Process); // // Apphelp functions // +INIT_FUNCTION NTSTATUS NTAPI ApphelpCacheInitialize(VOID); diff --git a/ntoskrnl/include/internal/se.h b/ntoskrnl/include/internal/se.h index 563cd23d33..e2285fd29d 100644 --- a/ntoskrnl/include/internal/se.h +++ b/ntoskrnl/include/internal/se.h @@ -243,26 +243,32 @@ SepSidInTokenEx( ); /* Functions */ +INIT_FUNCTION BOOLEAN NTAPI SeInitSystem(VOID); +INIT_FUNCTION VOID NTAPI ExpInitLuid(VOID); +INIT_FUNCTION VOID NTAPI SepInitPrivileges(VOID); +INIT_FUNCTION BOOLEAN NTAPI SepInitSecurityIDs(VOID); +INIT_FUNCTION BOOLEAN NTAPI SepInitDACLs(VOID); +INIT_FUNCTION BOOLEAN NTAPI SepInitSDs(VOID); @@ -329,6 +335,7 @@ SepCreateImpersonationTokenDacl( _Out_ PACL* Dacl ); +INIT_FUNCTION VOID NTAPI SepInitializeTokenImplementation(VOID); diff --git a/ntoskrnl/io/iomgr/arcname.c b/ntoskrnl/io/iomgr/arcname.c index 6ef7dd0e89..9d01104357 100644 --- a/ntoskrnl/io/iomgr/arcname.c +++ b/ntoskrnl/io/iomgr/arcname.c @@ -22,22 +22,22 @@ extern BOOLEAN IoRemoteBootClient; /* FUNCTIONS *****************************************************************/ -NTSTATUS INIT_FUNCTION +NTSTATUS NTAPI IopCreateArcNamesCd(IN PLOADER_PARAMETER_BLOCK LoaderBlock ); -NTSTATUS INIT_FUNCTION +NTSTATUS NTAPI IopCreateArcNamesDisk(IN PLOADER_PARAMETER_BLOCK LoaderBlock, IN BOOLEAN SingleDisk, IN PBOOLEAN FoundBoot ); -NTSTATUS INIT_FUNCTION +NTSTATUS NTAPI IopCreateArcNames(IN PLOADER_PARAMETER_BLOCK LoaderBlock) { @@ -147,8 +147,8 @@ IopCreateArcNames(IN PLOADER_PARAMETER_BLOCK LoaderBlock) return Status; } -NTSTATUS INIT_FUNCTION +NTSTATUS NTAPI IopCreateArcNamesCd(IN PLOADER_PARAMETER_BLOCK LoaderBlock) { @@ -409,8 +409,8 @@ Cleanup: return Status; } -NTSTATUS INIT_FUNCTION +NTSTATUS NTAPI IopCreateArcNamesDisk(IN PLOADER_PARAMETER_BLOCK LoaderBlock, IN BOOLEAN SingleDisk, @@ -831,9 +831,9 @@ Cleanup: return Status; } +INIT_FUNCTION NTSTATUS NTAPI -INIT_FUNCTION IopReassignSystemRoot(IN PLOADER_PARAMETER_BLOCK LoaderBlock, OUT PANSI_STRING NtBootPath) { diff --git a/ntoskrnl/io/iomgr/driver.c b/ntoskrnl/io/iomgr/driver.c index a1584f5810..c9fa6116c4 100644 --- a/ntoskrnl/io/iomgr/driver.c +++ b/ntoskrnl/io/iomgr/driver.c @@ -713,9 +713,9 @@ MiResolveImageReferences(IN PVOID ImageBase, // // Used for images already loaded (boot drivers) // +INIT_FUNCTION NTSTATUS NTAPI -INIT_FUNCTION LdrProcessDriverModule(PLDR_DATA_TABLE_ENTRY LdrEntry, PUNICODE_STRING FileName, PLDR_DATA_TABLE_ENTRY *ModuleObject) @@ -793,9 +793,9 @@ LdrProcessDriverModule(PLDR_DATA_TABLE_ENTRY LdrEntry, * * Initialize a driver that is already loaded in memory. */ +INIT_FUNCTION NTSTATUS NTAPI -INIT_FUNCTION IopInitializeBuiltinDriver(IN PLDR_DATA_TABLE_ENTRY BootLdrEntry) { PDEVICE_NODE DeviceNode; @@ -924,9 +924,9 @@ IopInitializeBuiltinDriver(IN PLDR_DATA_TABLE_ENTRY BootLdrEntry) * Return Value * None */ +INIT_FUNCTION VOID FASTCALL -INIT_FUNCTION IopInitializeBootDrivers(VOID) { PLIST_ENTRY ListHead, NextEntry, NextEntry2; @@ -1120,9 +1120,9 @@ IopInitializeBootDrivers(VOID) InitializeListHead(&KeLoaderBlock->LoadOrderListHead); } +INIT_FUNCTION VOID FASTCALL -INIT_FUNCTION IopInitializeSystemDrivers(VOID) { PUNICODE_STRING *DriverList, *SavedList; diff --git a/ntoskrnl/io/iomgr/ramdisk.c b/ntoskrnl/io/iomgr/ramdisk.c index 810b106203..67ec971982 100644 --- a/ntoskrnl/io/iomgr/ramdisk.c +++ b/ntoskrnl/io/iomgr/ramdisk.c @@ -22,9 +22,9 @@ /* FUNCTIONS ******************************************************************/ +INIT_FUNCTION NTSTATUS NTAPI -INIT_FUNCTION IopStartRamdisk(IN PLOADER_PARAMETER_BLOCK LoaderBlock) { PMEMORY_ALLOCATION_DESCRIPTOR MemoryDescriptor; diff --git a/ntoskrnl/io/iomgr/rawfs.c b/ntoskrnl/io/iomgr/rawfs.c index 569be1a1bf..de3a90f1b8 100644 --- a/ntoskrnl/io/iomgr/rawfs.c +++ b/ntoskrnl/io/iomgr/rawfs.c @@ -1187,9 +1187,9 @@ RawUnload(IN PDRIVER_OBJECT DriverObject) #endif } +INIT_FUNCTION NTSTATUS NTAPI -INIT_FUNCTION RawFsDriverEntry(IN PDRIVER_OBJECT DriverObject, IN PUNICODE_STRING RegistryPath) { diff --git a/ntoskrnl/io/pnpmgr/pnpinit.c b/ntoskrnl/io/pnpmgr/pnpinit.c index 5ae33e377f..944704aa3b 100644 --- a/ntoskrnl/io/pnpmgr/pnpinit.c +++ b/ntoskrnl/io/pnpmgr/pnpinit.c @@ -42,9 +42,9 @@ IopInitializeArbiters(VOID) return STATUS_SUCCESS; } +INIT_FUNCTION NTSTATUS NTAPI -INIT_FUNCTION PiInitCacheGroupInformation(VOID) { HANDLE KeyHandle; @@ -374,9 +374,9 @@ Exit: return Status; } +INIT_FUNCTION NTSTATUS NTAPI -INIT_FUNCTION IopInitializePlugPlayServices(VOID) { NTSTATUS Status; diff --git a/ntoskrnl/io/pnpmgr/pnpmgr.c b/ntoskrnl/io/pnpmgr/pnpmgr.c index 9c0d030464..1362a89f03 100644 --- a/ntoskrnl/io/pnpmgr/pnpmgr.c +++ b/ntoskrnl/io/pnpmgr/pnpmgr.c @@ -3095,7 +3095,9 @@ IopInitializePnpServices(IN PDEVICE_NODE DeviceNode) return IopTraverseDeviceTree(&Context); } -static NTSTATUS INIT_FUNCTION +static +INIT_FUNCTION +NTSTATUS IopEnumerateDetectedDevices( IN HANDLE hBaseKey, IN PUNICODE_STRING RelativePath OPTIONAL, @@ -3526,7 +3528,9 @@ cleanup: return Status; } -static BOOLEAN INIT_FUNCTION +static +INIT_FUNCTION +BOOLEAN IopIsFirmwareMapperDisabled(VOID) { UNICODE_STRING KeyPathU = RTL_CONSTANT_STRING(L"\\Registry\\Machine\\SYSTEM\\CURRENTCONTROLSET\\Control\\Pnp"); @@ -3594,9 +3598,9 @@ IopIsFirmwareMapperDisabled(VOID) return (KeyValue != 0) ? TRUE : FALSE; } +INIT_FUNCTION NTSTATUS NTAPI -INIT_FUNCTION IopUpdateRootKey(VOID) { UNICODE_STRING EnumU = RTL_CONSTANT_STRING(L"\\Registry\\Machine\\SYSTEM\\CurrentControlSet\\Enum"); diff --git a/ntoskrnl/ke/amd64/kiinit.c b/ntoskrnl/ke/amd64/kiinit.c index a8647203ce..3afeaf8858 100644 --- a/ntoskrnl/ke/amd64/kiinit.c +++ b/ntoskrnl/ke/amd64/kiinit.c @@ -40,6 +40,7 @@ void KiSystemCallEntry32(); /* FUNCTIONS *****************************************************************/ +INIT_FUNCTION VOID NTAPI KiInitMachineDependent(VOID) @@ -364,6 +365,7 @@ KiInitModuleList(IN PLOADER_PARAMETER_BLOCK LoaderBlock) } } +INIT_FUNCTION VOID NTAPI KiSystemStartup(IN PLOADER_PARAMETER_BLOCK LoaderBlock) diff --git a/ntoskrnl/ke/config.c b/ntoskrnl/ke/config.c index 9c40183e8e..ca3d8b009b 100644 --- a/ntoskrnl/ke/config.c +++ b/ntoskrnl/ke/config.c @@ -17,9 +17,9 @@ /* * @implemented */ +INIT_FUNCTION PCONFIGURATION_COMPONENT_DATA NTAPI -INIT_FUNCTION KeFindConfigurationEntry(IN PCONFIGURATION_COMPONENT_DATA Child, IN CONFIGURATION_CLASS Class, IN CONFIGURATION_TYPE Type, @@ -38,9 +38,9 @@ KeFindConfigurationEntry(IN PCONFIGURATION_COMPONENT_DATA Child, /* * @implemented */ +INIT_FUNCTION PCONFIGURATION_COMPONENT_DATA NTAPI -INIT_FUNCTION KeFindConfigurationNextEntry(IN PCONFIGURATION_COMPONENT_DATA Child, IN CONFIGURATION_CLASS Class, IN CONFIGURATION_TYPE Type, diff --git a/ntoskrnl/ke/i386/cpu.c b/ntoskrnl/ke/i386/cpu.c index ea582d8885..5f366665bd 100644 --- a/ntoskrnl/ke/i386/cpu.c +++ b/ntoskrnl/ke/i386/cpu.c @@ -85,9 +85,9 @@ setCx86(UCHAR reg, UCHAR data) /* FUNCTIONS *****************************************************************/ +INIT_FUNCTION VOID NTAPI -INIT_FUNCTION KiSetProcessorType(VOID) { ULONG EFlags, NewEFlags; @@ -152,9 +152,9 @@ KiSetProcessorType(VOID) __writeeflags(EFlags); } +INIT_FUNCTION ULONG NTAPI -INIT_FUNCTION KiGetCpuVendor(VOID) { PKPRCB Prcb = KeGetCurrentPrcb(); @@ -208,9 +208,9 @@ KiGetCpuVendor(VOID) return CPU_UNKNOWN; } +INIT_FUNCTION ULONG NTAPI -INIT_FUNCTION KiGetFeatureBits(VOID) { PKPRCB Prcb = KeGetCurrentPrcb(); @@ -454,9 +454,9 @@ KiGetFeatureBits(VOID) return FeatureBits; } +INIT_FUNCTION VOID NTAPI -INIT_FUNCTION KiGetCacheInformation(VOID) { PKIPCR Pcr = (PKIPCR)KeGetPcr(); @@ -722,9 +722,9 @@ KiGetCacheInformation(VOID) Pcr->SecondLevelCacheAssociativity); } +INIT_FUNCTION VOID NTAPI -INIT_FUNCTION KiSetCR0Bits(VOID) { ULONG Cr0; @@ -739,9 +739,9 @@ KiSetCR0Bits(VOID) __writecr0(Cr0); } +INIT_FUNCTION VOID NTAPI -INIT_FUNCTION KiInitializeTSS2(IN PKTSS Tss, IN PKGDTENTRY TssEntry OPTIONAL) { @@ -793,9 +793,9 @@ KiInitializeTSS(IN PKTSS Tss) Tss->Ss0 = KGDT_R0_DATA; } +INIT_FUNCTION VOID FASTCALL -INIT_FUNCTION Ki386InitializeTss(IN PKTSS Tss, IN PKIDTENTRY Idt, IN PKGDTENTRY Gdt) @@ -982,18 +982,18 @@ KiSaveProcessorControlState(OUT PKPROCESSOR_STATE ProcessorState) ProcessorState->SpecialRegisters.Ldtr = Ke386GetLocalDescriptorTable(); } +INIT_FUNCTION VOID NTAPI -INIT_FUNCTION KiInitializeMachineType(VOID) { /* Set the Machine Type we got from NTLDR */ KeI386MachineType = KeLoaderBlock->u.I386.MachineType & 0x000FF; } +INIT_FUNCTION ULONG_PTR NTAPI -INIT_FUNCTION KiLoadFastSyscallMachineSpecificRegisters(IN ULONG_PTR Context) { /* Set CS and ESP */ @@ -1005,9 +1005,9 @@ KiLoadFastSyscallMachineSpecificRegisters(IN ULONG_PTR Context) return 0; } +INIT_FUNCTION VOID NTAPI -INIT_FUNCTION KiRestoreFastSyscallReturnState(VOID) { /* Check if the CPU Supports fast system call */ @@ -1039,9 +1039,9 @@ KiRestoreFastSyscallReturnState(VOID) } } +INIT_FUNCTION ULONG_PTR NTAPI -INIT_FUNCTION Ki386EnableDE(IN ULONG_PTR Context) { /* Enable DE */ @@ -1049,9 +1049,9 @@ Ki386EnableDE(IN ULONG_PTR Context) return 0; } +INIT_FUNCTION ULONG_PTR NTAPI -INIT_FUNCTION Ki386EnableFxsr(IN ULONG_PTR Context) { /* Enable FXSR */ @@ -1059,9 +1059,9 @@ Ki386EnableFxsr(IN ULONG_PTR Context) return 0; } +INIT_FUNCTION ULONG_PTR NTAPI -INIT_FUNCTION Ki386EnableXMMIExceptions(IN ULONG_PTR Context) { PKIDTENTRY IdtEntry; @@ -1082,9 +1082,9 @@ Ki386EnableXMMIExceptions(IN ULONG_PTR Context) return 0; } +INIT_FUNCTION VOID NTAPI -INIT_FUNCTION KiI386PentiumLockErrataFixup(VOID) { KDESCRIPTOR IdtDescriptor = {0, 0, 0}; @@ -1158,9 +1158,9 @@ KiSaveProcessorState(IN PKTRAP_FRAME TrapFrame, KiSaveProcessorControlState(&Prcb->ProcessorState); } +INIT_FUNCTION BOOLEAN NTAPI -INIT_FUNCTION KiIsNpxPresent(VOID) { ULONG Cr0; @@ -1199,9 +1199,9 @@ KiIsNpxPresent(VOID) return TRUE; } +INIT_FUNCTION BOOLEAN NTAPI -INIT_FUNCTION KiIsNpxErrataPresent(VOID) { static double Value1 = 4195835.0, Value2 = 3145727.0; diff --git a/ntoskrnl/ke/i386/kiinit.c b/ntoskrnl/ke/i386/kiinit.c index c17f4dd1f3..6d437a0581 100644 --- a/ntoskrnl/ke/i386/kiinit.c +++ b/ntoskrnl/ke/i386/kiinit.c @@ -31,7 +31,7 @@ ULONGLONG BootCycles, BootCyclesEnd; /* FUNCTIONS *****************************************************************/ -INIT_SECTION +INIT_FUNCTION VOID NTAPI KiInitMachineDependent(VOID) @@ -330,7 +330,7 @@ KiInitMachineDependent(VOID) KiSetCR0Bits(); } -INIT_SECTION +INIT_FUNCTION VOID NTAPI KiInitializePcr(IN ULONG ProcessorNumber, @@ -392,7 +392,7 @@ KiInitializePcr(IN ULONG ProcessorNumber, Pcr->PrcbData.MultiThreadProcessorSet = Pcr->PrcbData.SetMember; } -INIT_SECTION +INIT_FUNCTION VOID NTAPI KiInitializeKernel(IN PKPROCESS InitProcess, @@ -617,7 +617,7 @@ KiInitializeKernel(IN PKPROCESS InitProcess, LoaderBlock->Prcb = 0; } -INIT_SECTION +INIT_FUNCTION VOID FASTCALL KiGetMachineBootPointers(IN PKGDTENTRY *Gdt, @@ -658,7 +658,7 @@ KiGetMachineBootPointers(IN PKGDTENTRY *Gdt, TssSelector.HighWord.Bytes.BaseHi << 24); } -INIT_SECTION +INIT_FUNCTION VOID NTAPI KiSystemStartupBootStack(VOID) @@ -710,7 +710,7 @@ KiMarkPageAsReadOnly( __invlpg(Address); } -INIT_SECTION +INIT_FUNCTION VOID NTAPI KiSystemStartup(IN PLOADER_PARAMETER_BLOCK LoaderBlock) diff --git a/ntoskrnl/ke/i386/mtrr.c b/ntoskrnl/ke/i386/mtrr.c index 13f76950e0..ed2a7fb7ba 100644 --- a/ntoskrnl/ke/i386/mtrr.c +++ b/ntoskrnl/ke/i386/mtrr.c @@ -16,18 +16,18 @@ /* FUNCTIONS *****************************************************************/ +INIT_FUNCTION VOID NTAPI -INIT_FUNCTION KiInitializeMTRR(IN BOOLEAN FinalCpu) { /* FIXME: Support this */ DPRINT("MTRR support detected but not yet taken advantage of\n"); } +INIT_FUNCTION VOID NTAPI -INIT_FUNCTION KiAmdK6InitializeMTRR(VOID) { /* FIXME: Support this */ diff --git a/ntoskrnl/ke/i386/patpge.c b/ntoskrnl/ke/i386/patpge.c index a0e9b49424..8a27d7a738 100644 --- a/ntoskrnl/ke/i386/patpge.c +++ b/ntoskrnl/ke/i386/patpge.c @@ -17,7 +17,7 @@ /* FUNCTIONS *****************************************************************/ -INIT_SECTION +INIT_FUNCTION ULONG_PTR NTAPI Ki386EnableGlobalPage(IN ULONG_PTR Context) @@ -55,18 +55,18 @@ Ki386EnableGlobalPage(IN ULONG_PTR Context) return 0; } +INIT_FUNCTION VOID NTAPI -INIT_FUNCTION KiInitializePAT(VOID) { /* FIXME: Support this */ DPRINT("PAT support detected but not yet taken advantage of\n"); } +INIT_FUNCTION ULONG_PTR NTAPI -INIT_FUNCTION Ki386EnableTargetLargePage(IN ULONG_PTR Context) { PLARGE_IDENTITY_MAP IdentityMap = (PLARGE_IDENTITY_MAP)Context; diff --git a/ntoskrnl/ke/krnlinit.c b/ntoskrnl/ke/krnlinit.c index 96ac3d2612..accdeae7ef 100644 --- a/ntoskrnl/ke/krnlinit.c +++ b/ntoskrnl/ke/krnlinit.c @@ -65,9 +65,9 @@ KSPIN_LOCK KiReverseStallIpiLock; /* FUNCTIONS *****************************************************************/ +INIT_FUNCTION VOID NTAPI -INIT_FUNCTION KiInitSystem(VOID) { ULONG i; @@ -117,9 +117,9 @@ KiInitSystem(VOID) sizeof(KeServiceDescriptorTable)); } +INIT_FUNCTION LARGE_INTEGER NTAPI -INIT_FUNCTION KiComputeReciprocal(IN LONG Divisor, OUT PUCHAR Shift) { @@ -181,9 +181,9 @@ KiComputeReciprocal(IN LONG Divisor, return Reciprocal; } +INIT_FUNCTION VOID NTAPI -INIT_FUNCTION KiInitSpinLocks(IN PKPRCB Prcb, IN CCHAR Number) { @@ -287,9 +287,9 @@ KiInitSpinLocks(IN PKPRCB Prcb, } } +INIT_FUNCTION BOOLEAN NTAPI -INIT_FUNCTION KeInitSystem(VOID) { /* Check if Threaded DPCs are enabled */ diff --git a/ntoskrnl/lpc/port.c b/ntoskrnl/lpc/port.c index 7ca93a1574..ea49eb0c4b 100644 --- a/ntoskrnl/lpc/port.c +++ b/ntoskrnl/lpc/port.c @@ -31,9 +31,9 @@ static GENERIC_MAPPING LpcpPortMapping = /* PRIVATE FUNCTIONS *********************************************************/ +INIT_FUNCTION BOOLEAN NTAPI -INIT_FUNCTION LpcInitSystem(VOID) { OBJECT_TYPE_INITIALIZER ObjectTypeInitializer; diff --git a/ntoskrnl/mm/ARM3/expool.c b/ntoskrnl/mm/ARM3/expool.c index 0828126d87..af83d88f05 100644 --- a/ntoskrnl/mm/ARM3/expool.c +++ b/ntoskrnl/mm/ARM3/expool.c @@ -628,9 +628,9 @@ MiDumpPoolConsumers(BOOLEAN CalledFromDbg, ULONG Tag, ULONG Mask, ULONG Flags) /* PRIVATE FUNCTIONS **********************************************************/ +INIT_FUNCTION VOID NTAPI -INIT_SECTION ExpSeedHotTags(VOID) { ULONG i, Key, Hash, Index; @@ -958,9 +958,9 @@ ExpInsertPoolTracker(IN ULONG Key, DPRINT1("Out of pool tag space, ignoring...\n"); } +INIT_FUNCTION VOID NTAPI -INIT_SECTION ExInitializePoolDescriptor(IN PPOOL_DESCRIPTOR PoolDescriptor, IN POOL_TYPE PoolType, IN ULONG PoolIndex, @@ -1009,9 +1009,9 @@ ExInitializePoolDescriptor(IN PPOOL_DESCRIPTOR PoolDescriptor, ASSERT(PoolType != PagedPoolSession); } +INIT_FUNCTION VOID NTAPI -INIT_SECTION InitializePool(IN POOL_TYPE PoolType, IN ULONG Threshold) { diff --git a/ntoskrnl/mm/ARM3/i386/init.c b/ntoskrnl/mm/ARM3/i386/init.c index 58cb5ba03c..6d3e2e7045 100644 --- a/ntoskrnl/mm/ARM3/i386/init.c +++ b/ntoskrnl/mm/ARM3/i386/init.c @@ -39,9 +39,9 @@ MMPTE MmDecommittedPte = {{MM_DECOMMIT << MM_PTE_SOFTWARE_PROTECTION_BITS}}; /* PRIVATE FUNCTIONS **********************************************************/ +INIT_FUNCTION VOID NTAPI -INIT_FUNCTION MiInitializeSessionSpaceLayout(VOID) { // @@ -120,9 +120,9 @@ MiInitializeSessionSpaceLayout(VOID) MM_ALLOCATION_GRANULARITY); } +INIT_FUNCTION VOID NTAPI -INIT_FUNCTION MiComputeNonPagedPoolVa(IN ULONG FreePages) { IN PFN_NUMBER PoolPages; @@ -236,9 +236,9 @@ MiComputeNonPagedPoolVa(IN ULONG FreePages) } } +INIT_FUNCTION NTSTATUS NTAPI -INIT_FUNCTION MiInitMachineDependent(IN PLOADER_PARAMETER_BLOCK LoaderBlock) { PFN_NUMBER PageFrameIndex; diff --git a/ntoskrnl/mm/ARM3/largepag.c b/ntoskrnl/mm/ARM3/largepag.c index f169b4970b..e0c5ce9d56 100644 --- a/ntoskrnl/mm/ARM3/largepag.c +++ b/ntoskrnl/mm/ARM3/largepag.c @@ -28,9 +28,9 @@ BOOLEAN MiLargePageAllDrivers; /* FUNCTIONS ******************************************************************/ +INIT_FUNCTION VOID NTAPI -INIT_FUNCTION MiInitializeLargePageSupport(VOID) { #if _MI_PAGING_LEVELS > 2 @@ -48,9 +48,9 @@ MiInitializeLargePageSupport(VOID) #endif } +INIT_FUNCTION VOID NTAPI -INIT_FUNCTION MiSyncCachedRanges(VOID) { ULONG i; @@ -62,9 +62,9 @@ MiSyncCachedRanges(VOID) } } +INIT_FUNCTION VOID NTAPI -INIT_FUNCTION MiInitializeDriverLargePageList(VOID) { PWCHAR p, pp; diff --git a/ntoskrnl/mm/ARM3/miarm.h b/ntoskrnl/mm/ARM3/miarm.h index 00801d8c16..27ff0718ba 100644 --- a/ntoskrnl/mm/ARM3/miarm.h +++ b/ntoskrnl/mm/ARM3/miarm.h @@ -1667,6 +1667,7 @@ MiQueryPageTableReferences(IN PVOID Address) return *RefCount; } +INIT_FUNCTION BOOLEAN NTAPI MmArmInitSystem( @@ -1674,34 +1675,40 @@ MmArmInitSystem( IN PLOADER_PARAMETER_BLOCK LoaderBlock ); +INIT_FUNCTION VOID NTAPI MiInitializeSessionSpaceLayout(VOID); +INIT_FUNCTION NTSTATUS NTAPI MiInitMachineDependent( IN PLOADER_PARAMETER_BLOCK LoaderBlock ); +INIT_FUNCTION VOID NTAPI MiComputeColorInformation( VOID ); +INIT_FUNCTION VOID NTAPI MiMapPfnDatabase( IN PLOADER_PARAMETER_BLOCK LoaderBlock ); +INIT_FUNCTION VOID NTAPI MiInitializeColorTables( VOID ); +INIT_FUNCTION VOID NTAPI MiInitializePfnDatabase( @@ -1720,18 +1727,21 @@ MiInitializeSessionIds( VOID ); +INIT_FUNCTION BOOLEAN NTAPI MiInitializeMemoryEvents( VOID ); +INIT_FUNCTION PFN_NUMBER NTAPI MxGetNextPage( IN PFN_NUMBER PageCount ); +INIT_FUNCTION PPHYSICAL_MEMORY_DESCRIPTOR NTAPI MmInitializeMemoryLimits( @@ -1778,24 +1788,28 @@ MiCheckPdeForPagedPool( IN PVOID Address ); +INIT_FUNCTION VOID NTAPI MiInitializeNonPagedPool( VOID ); +INIT_FUNCTION VOID NTAPI MiInitializeNonPagedPoolThresholds( VOID ); +INIT_FUNCTION VOID NTAPI MiInitializePoolEvents( VOID ); +INIT_FUNCTION VOID // NTAPI // InitializePool( // @@ -1804,9 +1818,9 @@ InitializePool( // ); // // FIXFIX: THIS ONE TOO +INIT_FUNCTION VOID NTAPI -INIT_FUNCTION ExInitializePoolDescriptor( IN PPOOL_DESCRIPTOR PoolDescriptor, IN POOL_TYPE PoolType, @@ -1821,6 +1835,7 @@ MiInitializeSessionPool( VOID ); +INIT_FUNCTION VOID NTAPI MiInitializeSystemPtes( @@ -1982,18 +1997,21 @@ MiLookupDataTableEntry( IN PVOID Address ); +INIT_FUNCTION VOID NTAPI MiInitializeDriverLargePageList( VOID ); +INIT_FUNCTION VOID NTAPI MiInitializeLargePageSupport( VOID ); +INIT_FUNCTION VOID NTAPI MiSyncCachedRanges( diff --git a/ntoskrnl/mm/ARM3/mminit.c b/ntoskrnl/mm/ARM3/mminit.c index 217aa6569d..bcb8f1652a 100644 --- a/ntoskrnl/mm/ARM3/mminit.c +++ b/ntoskrnl/mm/ARM3/mminit.c @@ -477,9 +477,9 @@ MiScanMemoryDescriptors(IN PLOADER_PARAMETER_BLOCK LoaderBlock) MxOldFreeDescriptor = *MxFreeDescriptor; } +INIT_FUNCTION PFN_NUMBER NTAPI -INIT_FUNCTION MxGetNextPage(IN PFN_NUMBER PageCount) { PFN_NUMBER Pfn; @@ -502,9 +502,9 @@ MxGetNextPage(IN PFN_NUMBER PageCount) return Pfn; } +INIT_FUNCTION VOID NTAPI -INIT_FUNCTION MiComputeColorInformation(VOID) { ULONG L2Associativity; @@ -556,9 +556,9 @@ MiComputeColorInformation(VOID) KeGetCurrentPrcb()->SecondaryColorMask = MmSecondaryColorMask; } +INIT_FUNCTION VOID NTAPI -INIT_FUNCTION MiInitializeColorTables(VOID) { ULONG i; @@ -607,9 +607,9 @@ MiInitializeColorTables(VOID) } #ifndef _M_AMD64 +INIT_FUNCTION BOOLEAN NTAPI -INIT_FUNCTION MiIsRegularMemory(IN PLOADER_PARAMETER_BLOCK LoaderBlock, IN PFN_NUMBER Pfn) { @@ -666,9 +666,9 @@ MiIsRegularMemory(IN PLOADER_PARAMETER_BLOCK LoaderBlock, return FALSE; } +INIT_FUNCTION VOID NTAPI -INIT_FUNCTION MiMapPfnDatabase(IN PLOADER_PARAMETER_BLOCK LoaderBlock) { PFN_NUMBER FreePage, FreePageCount, PagesLeft, BasePage, PageCount; @@ -762,9 +762,9 @@ MiMapPfnDatabase(IN PLOADER_PARAMETER_BLOCK LoaderBlock) MxFreeDescriptor->PageCount = FreePageCount; } +INIT_FUNCTION VOID NTAPI -INIT_FUNCTION MiBuildPfnDatabaseFromPages(IN PLOADER_PARAMETER_BLOCK LoaderBlock) { PMMPDE PointerPde; @@ -871,9 +871,9 @@ MiBuildPfnDatabaseFromPages(IN PLOADER_PARAMETER_BLOCK LoaderBlock) } } +INIT_FUNCTION VOID NTAPI -INIT_FUNCTION MiBuildPfnDatabaseZeroPage(VOID) { PMMPFN Pfn1; @@ -894,9 +894,9 @@ MiBuildPfnDatabaseZeroPage(VOID) } } +INIT_FUNCTION VOID NTAPI -INIT_FUNCTION MiBuildPfnDatabaseFromLoaderBlock(IN PLOADER_PARAMETER_BLOCK LoaderBlock) { PLIST_ENTRY NextEntry; @@ -1038,9 +1038,9 @@ MiBuildPfnDatabaseFromLoaderBlock(IN PLOADER_PARAMETER_BLOCK LoaderBlock) } } +INIT_FUNCTION VOID NTAPI -INIT_FUNCTION MiBuildPfnDatabaseSelf(VOID) { PMMPTE PointerPte, LastPte; @@ -1068,9 +1068,9 @@ MiBuildPfnDatabaseSelf(VOID) } } +INIT_FUNCTION VOID NTAPI -INIT_FUNCTION MiInitializePfnDatabase(IN PLOADER_PARAMETER_BLOCK LoaderBlock) { /* Scan memory and start setting up PFN entries */ @@ -1087,9 +1087,9 @@ MiInitializePfnDatabase(IN PLOADER_PARAMETER_BLOCK LoaderBlock) } #endif /* !_M_AMD64 */ +INIT_FUNCTION VOID NTAPI -INIT_FUNCTION MmFreeLoaderBlock(IN PLOADER_PARAMETER_BLOCK LoaderBlock) { PLIST_ENTRY NextMd; @@ -1197,9 +1197,9 @@ MmFreeLoaderBlock(IN PLOADER_PARAMETER_BLOCK LoaderBlock) ExFreePoolWithTag(Buffer, 'lMmM'); } +INIT_FUNCTION VOID NTAPI -INIT_FUNCTION MiAdjustWorkingSetManagerParameters(IN BOOLEAN Client) { /* This function needs to do more work, for now, we tune page minimums */ @@ -1212,9 +1212,9 @@ MiAdjustWorkingSetManagerParameters(IN BOOLEAN Client) } } +INIT_FUNCTION VOID NTAPI -INIT_FUNCTION MiNotifyMemoryEvents(VOID) { /* Are we in a low-memory situation? */ @@ -1238,9 +1238,9 @@ MiNotifyMemoryEvents(VOID) } } +INIT_FUNCTION NTSTATUS NTAPI -INIT_FUNCTION MiCreateMemoryEvent(IN PUNICODE_STRING Name, OUT PKEVENT *Event) { @@ -1333,9 +1333,9 @@ CleanUp: return Status; } +INIT_FUNCTION BOOLEAN NTAPI -INIT_FUNCTION MiInitializeMemoryEvents(VOID) { UNICODE_STRING LowString = RTL_CONSTANT_STRING(L"\\KernelObjects\\LowMemoryCondition"); @@ -1412,9 +1412,9 @@ MiInitializeMemoryEvents(VOID) return TRUE; } +INIT_FUNCTION VOID NTAPI -INIT_FUNCTION MiAddHalIoMappings(VOID) { PVOID BaseAddress; @@ -1616,9 +1616,9 @@ MmDumpArmPfnDatabase(IN BOOLEAN StatusOnly) KeLowerIrql(OldIrql); } +INIT_FUNCTION PPHYSICAL_MEMORY_DESCRIPTOR NTAPI -INIT_FUNCTION MmInitializeMemoryLimits(IN PLOADER_PARAMETER_BLOCK LoaderBlock, IN PBOOLEAN IncludeType) { @@ -1745,9 +1745,9 @@ MmInitializeMemoryLimits(IN PLOADER_PARAMETER_BLOCK LoaderBlock, return Buffer; } +INIT_FUNCTION VOID NTAPI -INIT_FUNCTION MiBuildPagedPool(VOID) { PMMPTE PointerPte; @@ -1985,9 +1985,9 @@ MiBuildPagedPool(VOID) MiInitializeSystemSpaceMap(NULL); } +INIT_FUNCTION VOID NTAPI -INIT_FUNCTION MiDbgDumpMemoryDescriptors(VOID) { PLIST_ENTRY NextEntry; @@ -2037,9 +2037,9 @@ MiDbgDumpMemoryDescriptors(VOID) DPRINT1("Total: %08lX (%lu MB)\n", (ULONG)TotalPages, (ULONG)(TotalPages * PAGE_SIZE) / 1024 / 1024); } +INIT_FUNCTION BOOLEAN NTAPI -INIT_FUNCTION MmArmInitSystem(IN ULONG Phase, IN PLOADER_PARAMETER_BLOCK LoaderBlock) { diff --git a/ntoskrnl/mm/ARM3/pool.c b/ntoskrnl/mm/ARM3/pool.c index 9ef703ef2c..5d6554bad7 100644 --- a/ntoskrnl/mm/ARM3/pool.c +++ b/ntoskrnl/mm/ARM3/pool.c @@ -178,9 +178,9 @@ MiProtectedPoolRemoveEntryList(IN PLIST_ENTRY Entry) if (PoolBlink) MiProtectFreeNonPagedPool(PoolBlink, 1); } +INIT_FUNCTION VOID NTAPI -INIT_FUNCTION MiInitializeNonPagedPoolThresholds(VOID) { PFN_NUMBER Size = MmMaximumNonPagedPoolInPages; @@ -195,9 +195,9 @@ MiInitializeNonPagedPoolThresholds(VOID) ASSERT(MiLowNonPagedPoolThreshold < MiHighNonPagedPoolThreshold); } +INIT_FUNCTION VOID NTAPI -INIT_FUNCTION MiInitializePoolEvents(VOID) { KIRQL OldIrql; @@ -270,9 +270,9 @@ MiInitializePoolEvents(VOID) KeReleaseQueuedSpinLock(LockQueueMmNonPagedPoolLock, OldIrql); } +INIT_FUNCTION VOID NTAPI -INIT_FUNCTION MiInitializeNonPagedPool(VOID) { ULONG i; diff --git a/ntoskrnl/mm/ARM3/procsup.c b/ntoskrnl/mm/ARM3/procsup.c index 51502b9a5d..cbc784066a 100644 --- a/ntoskrnl/mm/ARM3/procsup.c +++ b/ntoskrnl/mm/ARM3/procsup.c @@ -1028,9 +1028,9 @@ MmInitializeProcessAddressSpace(IN PEPROCESS Process, return Status; } +INIT_FUNCTION NTSTATUS NTAPI -INIT_FUNCTION MmInitializeHandBuiltProcess(IN PEPROCESS Process, IN PULONG_PTR DirectoryTableBase) { @@ -1053,9 +1053,9 @@ MmInitializeHandBuiltProcess(IN PEPROCESS Process, return STATUS_SUCCESS; } +INIT_FUNCTION NTSTATUS NTAPI -INIT_FUNCTION MmInitializeHandBuiltProcess2(IN PEPROCESS Process) { /* Lock the VAD, ARM3-owned ranges away */ diff --git a/ntoskrnl/mm/ARM3/sysldr.c b/ntoskrnl/mm/ARM3/sysldr.c index d614b8bf3a..15b267d146 100644 --- a/ntoskrnl/mm/ARM3/sysldr.c +++ b/ntoskrnl/mm/ARM3/sysldr.c @@ -586,9 +586,9 @@ MiProcessLoaderEntry(IN PLDR_DATA_TABLE_ENTRY LdrEntry, KeLeaveCriticalRegion(); } +INIT_FUNCTION VOID NTAPI -INIT_FUNCTION MiUpdateThunks(IN PLOADER_PARAMETER_BLOCK LoaderBlock, IN PVOID OldBase, IN PVOID NewBase, @@ -1444,9 +1444,9 @@ MiFreeInitializationCode(IN PVOID InitStart, NULL); } +INIT_FUNCTION VOID NTAPI -INIT_FUNCTION MiFindInitializationCode(OUT PVOID *StartVa, OUT PVOID *EndVa) { @@ -1679,9 +1679,9 @@ MmFreeDriverInitialization(IN PLDR_DATA_TABLE_ENTRY LdrEntry) MiDeleteSystemPageableVm(StartPte, PageCount, 0, NULL); } +INIT_FUNCTION VOID NTAPI -INIT_FUNCTION MiReloadBootLoadedDrivers(IN PLOADER_PARAMETER_BLOCK LoaderBlock) { PLIST_ENTRY NextEntry; @@ -1868,9 +1868,9 @@ MiReloadBootLoadedDrivers(IN PLOADER_PARAMETER_BLOCK LoaderBlock) } } +INIT_FUNCTION NTSTATUS NTAPI -INIT_FUNCTION MiBuildImportsForBootDrivers(VOID) { PLIST_ENTRY NextEntry, NextEntry2; @@ -2133,9 +2133,9 @@ MiBuildImportsForBootDrivers(VOID) return STATUS_SUCCESS; } +INIT_FUNCTION VOID NTAPI -INIT_FUNCTION MiLocateKernelSections(IN PLDR_DATA_TABLE_ENTRY LdrEntry) { ULONG_PTR DllBase; @@ -2194,9 +2194,9 @@ MiLocateKernelSections(IN PLDR_DATA_TABLE_ENTRY LdrEntry) } } +INIT_FUNCTION BOOLEAN NTAPI -INIT_FUNCTION MiInitializeLoadedModuleList(IN PLOADER_PARAMETER_BLOCK LoaderBlock) { PLDR_DATA_TABLE_ENTRY LdrEntry, NewEntry; diff --git a/ntoskrnl/mm/ARM3/syspte.c b/ntoskrnl/mm/ARM3/syspte.c index 673b2e9a2c..3c1ec6ca6d 100644 --- a/ntoskrnl/mm/ARM3/syspte.c +++ b/ntoskrnl/mm/ARM3/syspte.c @@ -393,9 +393,9 @@ MiReleaseSystemPtes(IN PMMPTE StartingPte, KeReleaseQueuedSpinLock(LockQueueSystemSpaceLock, OldIrql); } +INIT_FUNCTION VOID NTAPI -INIT_FUNCTION MiInitializeSystemPtes(IN PMMPTE StartingPte, IN ULONG NumberOfPtes, IN MMSYSTEM_PTE_POOL_TYPE PoolType) diff --git a/ntoskrnl/mm/mminit.c b/ntoskrnl/mm/mminit.c index e0166ee8fb..4f328ab65c 100644 --- a/ntoskrnl/mm/mminit.c +++ b/ntoskrnl/mm/mminit.c @@ -39,8 +39,8 @@ extern NTSTATUS MiRosTrimCache(ULONG Target, ULONG Priority, PULONG NrFreed); // Helper function to create initial memory areas. // The created area is always read/write. // -VOID INIT_FUNCTION +VOID NTAPI MiCreateArm3StaticMemoryArea(PVOID BaseAddress, SIZE_T Size, BOOLEAN Executable) { @@ -61,8 +61,8 @@ MiCreateArm3StaticMemoryArea(PVOID BaseAddress, SIZE_T Size, BOOLEAN Executable) // TODO: Perhaps it would be prudent to bugcheck here, not only assert? } -VOID INIT_FUNCTION +VOID NTAPI MiInitSystemMemoryAreas(VOID) { @@ -117,9 +117,9 @@ MiInitSystemMemoryAreas(VOID) #endif /* _X86_ */ } +INIT_FUNCTION VOID NTAPI -INIT_FUNCTION MiDbgDumpAddressSpace(VOID) { // @@ -169,9 +169,9 @@ MiDbgDumpAddressSpace(VOID) "Non Paged Pool Expansion PTE Space"); } +INIT_FUNCTION NTSTATUS NTAPI -INIT_FUNCTION MmInitBsmThread(VOID) { NTSTATUS Status; @@ -193,9 +193,9 @@ MmInitBsmThread(VOID) return Status; } +INIT_FUNCTION BOOLEAN NTAPI -INIT_FUNCTION MmInitSystem(IN ULONG Phase, IN PLOADER_PARAMETER_BLOCK LoaderBlock) { diff --git a/ntoskrnl/ob/obinit.c b/ntoskrnl/ob/obinit.c index dcc2448a4a..e4de1a16d7 100644 --- a/ntoskrnl/ob/obinit.c +++ b/ntoskrnl/ob/obinit.c @@ -55,9 +55,9 @@ ULONG ObpInitializationPhase; /* PRIVATE FUNCTIONS *********************************************************/ static +INIT_FUNCTION NTSTATUS NTAPI -INIT_FUNCTION ObpCreateKernelObjectsSD(OUT PSECURITY_DESCRIPTOR *SecurityDescriptor) { PSECURITY_DESCRIPTOR Sd = NULL; diff --git a/ntoskrnl/ob/obname.c b/ntoskrnl/ob/obname.c index a9d05c8137..b1e541eeb4 100644 --- a/ntoskrnl/ob/obname.c +++ b/ntoskrnl/ob/obname.c @@ -34,9 +34,9 @@ ULONG ObpUnsecureGlobalNamesLength = sizeof(ObpUnsecureGlobalNamesBuffer); /* PRIVATE FUNCTIONS *********************************************************/ +INIT_FUNCTION NTSTATUS NTAPI -INIT_FUNCTION ObpCreateGlobalDosDevicesSD(OUT PSECURITY_DESCRIPTOR *SecurityDescriptor) { PSECURITY_DESCRIPTOR Sd = NULL; @@ -127,9 +127,9 @@ done: return Status; } +INIT_FUNCTION NTSTATUS NTAPI -INIT_FUNCTION ObpCreateDosDevicesDirectory(VOID) { OBJECT_ATTRIBUTES ObjectAttributes; diff --git a/ntoskrnl/ob/obsdcach.c b/ntoskrnl/ob/obsdcach.c index 7573ba69f0..4d6433cad8 100644 --- a/ntoskrnl/ob/obsdcach.c +++ b/ntoskrnl/ob/obsdcach.c @@ -55,9 +55,9 @@ ObpSdReleaseLockShared(IN POB_SD_CACHE_LIST CacheEntry) KeLeaveCriticalRegion(); } +INIT_FUNCTION NTSTATUS NTAPI -INIT_FUNCTION ObpInitSdCache(VOID) { ULONG i; diff --git a/ntoskrnl/po/power.c b/ntoskrnl/po/power.c index c34a660c86..a0dd4fb3af 100644 --- a/ntoskrnl/po/power.c +++ b/ntoskrnl/po/power.c @@ -289,9 +289,9 @@ PopSetSystemPowerState(SYSTEM_POWER_STATE PowerState, POWER_ACTION PowerAction) return Status; } +INIT_FUNCTION BOOLEAN NTAPI -INIT_FUNCTION PoInitSystem(IN ULONG BootPhase) { PVOID NotificationEntry; @@ -383,9 +383,9 @@ PopIdle0(IN PPROCESSOR_POWER_STATE PowerState) HalProcessorIdle(); } +INIT_FUNCTION VOID NTAPI -INIT_FUNCTION PoInitializePrcb(IN PKPRCB Prcb) { /* Initialize the Power State */ diff --git a/ntoskrnl/ps/apphelp.c b/ntoskrnl/ps/apphelp.c index 6cdea62bca..7692c7ab2e 100644 --- a/ntoskrnl/ps/apphelp.c +++ b/ntoskrnl/ps/apphelp.c @@ -434,9 +434,9 @@ ApphelpCacheWrite(VOID) } +INIT_FUNCTION NTSTATUS NTAPI -INIT_FUNCTION ApphelpCacheInitialize(VOID) { DPRINT("SHIMS: ApphelpCacheInitialize\n"); diff --git a/ntoskrnl/ps/job.c b/ntoskrnl/ps/job.c index fd0049c991..f37de8bbb0 100644 --- a/ntoskrnl/ps/job.c +++ b/ntoskrnl/ps/job.c @@ -105,9 +105,9 @@ PspDeleteJob ( PVOID ObjectBody ) ExDeleteResource(&Job->JobLock); } +INIT_FUNCTION VOID NTAPI -INIT_FUNCTION PspInitializeJobStructures(VOID) { InitializeListHead(&PsJobListHead); diff --git a/ntoskrnl/ps/psmgr.c b/ntoskrnl/ps/psmgr.c index ed01622235..317861c128 100644 --- a/ntoskrnl/ps/psmgr.c +++ b/ntoskrnl/ps/psmgr.c @@ -62,9 +62,9 @@ BOOLEAN PspDoingGiveBacks; /* PRIVATE FUNCTIONS *********************************************************/ +INIT_FUNCTION USHORT NTAPI -INIT_FUNCTION NameToOrdinal(IN PCHAR Name, IN PVOID DllBase, IN ULONG NumberOfNames, @@ -105,9 +105,9 @@ NameToOrdinal(IN PCHAR Name, return NameToOrdinal(Name, DllBase, NumberOfNames, NameTable, OrdinalTable); } +INIT_FUNCTION NTSTATUS NTAPI -INIT_FUNCTION LookupEntryPoint(IN PVOID DllBase, IN PCHAR Name, OUT PVOID *EntryPoint) @@ -157,9 +157,9 @@ LookupEntryPoint(IN PVOID DllBase, return STATUS_SUCCESS; } +INIT_FUNCTION NTSTATUS NTAPI -INIT_FUNCTION PspLookupSystemDllEntryPoint(IN PCHAR Name, IN PVOID *EntryPoint) { @@ -167,9 +167,9 @@ PspLookupSystemDllEntryPoint(IN PCHAR Name, return LookupEntryPoint(PspSystemDllBase, Name, EntryPoint); } +INIT_FUNCTION NTSTATUS NTAPI -INIT_FUNCTION PspLookupKernelUserEntryPoints(VOID) { NTSTATUS Status; @@ -273,9 +273,9 @@ PspMapSystemDll(IN PEPROCESS Process, return Status; } +INIT_FUNCTION NTSTATUS NTAPI -INIT_FUNCTION PsLocateSystemDll(VOID) { OBJECT_ATTRIBUTES ObjectAttributes; @@ -359,9 +359,9 @@ PsLocateSystemDll(VOID) return Status; } +INIT_FUNCTION NTSTATUS NTAPI -INIT_FUNCTION PspInitializeSystemDll(VOID) { NTSTATUS Status; @@ -392,9 +392,9 @@ PspInitializeSystemDll(VOID) return Status; } +INIT_FUNCTION BOOLEAN NTAPI -INIT_FUNCTION PspInitPhase1(VOID) { /* Initialize the System DLL and return status of operation */ @@ -402,9 +402,9 @@ PspInitPhase1(VOID) return TRUE; } +INIT_FUNCTION BOOLEAN NTAPI -INIT_FUNCTION PspInitPhase0(IN PLOADER_PARAMETER_BLOCK LoaderBlock) { NTSTATUS Status; @@ -620,9 +620,9 @@ PspInitPhase0(IN PLOADER_PARAMETER_BLOCK LoaderBlock) return TRUE; } +INIT_FUNCTION BOOLEAN NTAPI -INIT_FUNCTION PsInitSystem(IN PLOADER_PARAMETER_BLOCK LoaderBlock) { /* Check the initialization phase */ diff --git a/ntoskrnl/ps/quota.c b/ntoskrnl/ps/quota.c index f955818f78..b813190a76 100644 --- a/ntoskrnl/ps/quota.c +++ b/ntoskrnl/ps/quota.c @@ -95,9 +95,9 @@ PspReturnProcessQuotaSpecifiedPool(IN PEPROCESS Process, /* FUNCTIONS ***************************************************************/ +INIT_FUNCTION VOID NTAPI -INIT_FUNCTION PsInitializeQuotaSystem(VOID) { RtlZeroMemory(&PspDefaultQuotaBlock, sizeof(PspDefaultQuotaBlock)); diff --git a/ntoskrnl/se/semgr.c b/ntoskrnl/se/semgr.c index 389f6bf765..3156e64227 100644 --- a/ntoskrnl/se/semgr.c +++ b/ntoskrnl/se/semgr.c @@ -24,8 +24,9 @@ extern ERESOURCE SepSubjectContextLock; /* PRIVATE FUNCTIONS **********************************************************/ -static BOOLEAN +static INIT_FUNCTION +BOOLEAN SepInitExports(VOID) { SepExports.SeCreateTokenPrivilege = SeCreateTokenPrivilege; @@ -89,9 +90,9 @@ SepInitExports(VOID) } +INIT_FUNCTION BOOLEAN NTAPI -INIT_FUNCTION SepInitializationPhase0(VOID) { PAGED_CODE(); @@ -124,9 +125,9 @@ SepInitializationPhase0(VOID) return TRUE; } +INIT_FUNCTION BOOLEAN NTAPI -INIT_FUNCTION SepInitializationPhase1(VOID) { OBJECT_ATTRIBUTES ObjectAttributes; @@ -232,9 +233,9 @@ SepInitializationPhase1(VOID) return TRUE; } +INIT_FUNCTION BOOLEAN NTAPI -INIT_FUNCTION SeInitSystem(VOID) { /* Check the initialization phase */ diff --git a/ntoskrnl/vdm/vdmmain.c b/ntoskrnl/vdm/vdmmain.c index 8bedcd9cdc..32a45a9ba4 100644 --- a/ntoskrnl/vdm/vdmmain.c +++ b/ntoskrnl/vdm/vdmmain.c @@ -17,9 +17,9 @@ /* PRIVATE FUNCTIONS *********************************************************/ +INIT_FUNCTION VOID NTAPI -INIT_FUNCTION Ki386VdmEnablePentiumExtentions(IN BOOLEAN Enable) { ULONG EFlags, Cr4; @@ -36,9 +36,9 @@ Ki386VdmEnablePentiumExtentions(IN BOOLEAN Enable) __writeeflags(EFlags); } +INIT_FUNCTION VOID NTAPI -INIT_FUNCTION KeI386VdmInitialize(VOID) { NTSTATUS Status; diff --git a/sdk/cmake/msvc.cmake b/sdk/cmake/msvc.cmake index eda0972729..747b23b199 100644 --- a/sdk/cmake/msvc.cmake +++ b/sdk/cmake/msvc.cmake @@ -139,9 +139,9 @@ if(RUNTIME_CHECKS) add_compile_flags("/RTC1") endif() -set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /MANIFEST:NO /INCREMENTAL:NO /SAFESEH:NO /NODEFAULTLIB /RELEASE ${_hotpatch_link_flag}") -set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /MANIFEST:NO /INCREMENTAL:NO /SAFESEH:NO /NODEFAULTLIB /RELEASE /IGNORE:4104 ${_hotpatch_link_flag}") -set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} /MANIFEST:NO /INCREMENTAL:NO /SAFESEH:NO /NODEFAULTLIB /RELEASE ${_hotpatch_link_flag}") +set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /MANIFEST:NO /INCREMENTAL:NO /SAFESEH:NO /NODEFAULTLIB /RELEASE ${_hotpatch_link_flag} /IGNORE:4039") +set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /MANIFEST:NO /INCREMENTAL:NO /SAFESEH:NO /NODEFAULTLIB /RELEASE ${_hotpatch_link_flag} /IGNORE:4104 /IGNORE:4039") +set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} /MANIFEST:NO /INCREMENTAL:NO /SAFESEH:NO /NODEFAULTLIB /RELEASE ${_hotpatch_link_flag} /IGNORE:4039") # HACK: Remove the /implib argument, implibs are generated separately string(REPLACE "/implib:<TARGET_IMPLIB>" "" CMAKE_C_LINK_EXECUTABLE "${CMAKE_C_LINK_EXECUTABLE}") diff --git a/sdk/include/ndk/halfuncs.h b/sdk/include/ndk/halfuncs.h index 29877c5a58..03e869887a 100644 --- a/sdk/include/ndk/halfuncs.h +++ b/sdk/include/ndk/halfuncs.h @@ -25,6 +25,7 @@ Author: #include <umtypes.h> #include <haltypes.h> #include <ketypes.h> +#include <section_attribs.h> #ifndef NTOS_MODE_USER @@ -80,6 +81,7 @@ HalInitializeProcessor( _In_ struct _LOADER_PARAMETER_BLOCK *LoaderBlock ); +INIT_FUNCTION NTHALAPI BOOLEAN NTAPI @@ -175,6 +177,7 @@ HalGetInterruptSource( ); #endif +INIT_FUNCTION NTHALAPI VOID NTAPI diff --git a/sdk/include/ndk/inbvfuncs.h b/sdk/include/ndk/inbvfuncs.h index 61855e9054..df121830cb 100644 --- a/sdk/include/ndk/inbvfuncs.h +++ b/sdk/include/ndk/inbvfuncs.h @@ -24,6 +24,7 @@ Author: // #include <umtypes.h> #include <inbvtypes.h> +#include <section_attribs.h> #ifndef NTOS_MODE_USER // @@ -50,6 +51,7 @@ InbvNotifyDisplayOwnershipLost( // // Installation Functions // +INIT_FUNCTION VOID NTAPI InbvEnableBootDriver( diff --git a/sdk/include/ndk/kefuncs.h b/sdk/include/ndk/kefuncs.h index f0b1c275f0..6d7b713cc8 100644 --- a/sdk/include/ndk/kefuncs.h +++ b/sdk/include/ndk/kefuncs.h @@ -24,6 +24,7 @@ Author: // #include <umtypes.h> #include <ketypes.h> +#include <section_attribs.h> #ifndef NTOS_MODE_USER @@ -244,6 +245,7 @@ KeSignalCallDpcSynchronize( // ARC Configuration Functions. Only enabled if you have ARC Support // #ifdef _ARC_ +INIT_FUNCTION PCONFIGURATION_COMPONENT_DATA NTAPI KeFindConfigurationNextEntry( @@ -254,6 +256,7 @@ KeFindConfigurationNextEntry( _In_ PCONFIGURATION_COMPONENT_DATA *NextLink ); +INIT_FUNCTION PCONFIGURATION_COMPONENT_DATA NTAPI KeFindConfigurationEntry( diff --git a/sdk/include/ndk/section_attribs.h b/sdk/include/ndk/section_attribs.h new file mode 100644 index 0000000000..a35fae81eb --- /dev/null +++ b/sdk/include/ndk/section_attribs.h @@ -0,0 +1,41 @@ +/*++ NDK Version: 0099 + +Copyright (c) Alex Ionescu. All rights reserved. + +Header Name: + + section_attribs.h + +Abstract: + + Preprocessor definitions to put code and data into the INIT section. + +Author: + + Timo Kreuzer (timo.kreuzer(a)reactos.org) + +--*/ + +#pragma once + +#ifdef __GNUC__ + +#define INIT_SECTION __attribute__((section ("INIT"))) +#define INIT_FUNCTION __attribute__((section ("INIT"))) + +#elif defined(_MSC_VER) + +#pragma comment(linker, "/SECTION:INIT,ERW") +#define INIT_SECTION __declspec(allocate("INIT")) +#if (_MSC_VER >= 1800) // Visual Studio 2013 / version 12.0 +#define INIT_FUNCTION __declspec(code_seg("INIT")) +#else +#pragma section("INIT", read,execute,discard) +#define INIT_FUNCTION +#endif + +#else + +#error Invalid compiler! + +#endif diff --git a/win32ss/gdi/eng/ldevobj.h b/win32ss/gdi/eng/ldevobj.h index 5405ec1c69..a689914ad6 100644 --- a/win32ss/gdi/eng/ldevobj.h +++ b/win32ss/gdi/eng/ldevobj.h @@ -51,6 +51,7 @@ NTAPI EngGetLDEV( PDEVMODEW pdm); +INIT_FUNCTION NTSTATUS APIENTRY DriverEntry ( diff --git a/win32ss/user/ntuser/main.c b/win32ss/user/ntuser/main.c index b97a1f3d37..318a7ea70e 100644 --- a/win32ss/user/ntuser/main.c +++ b/win32ss/user/ntuser/main.c @@ -904,7 +904,7 @@ DriverUnload(IN PDRIVER_OBJECT DriverObject) /* * This definition doesn't work */ -INIT_SECTION +INIT_FUNCTION NTSTATUS APIENTRY DriverEntry( diff --git a/win32ss/win32kp.h b/win32ss/win32kp.h index 1bdcf38edd..2d0f358597 100644 --- a/win32ss/win32kp.h +++ b/win32ss/win32kp.h @@ -10,14 +10,6 @@ #pragma once -#ifdef __GNUC__ -#define INIT_SECTION __attribute__((section ("INIT"))) -#define INIT_FUNCTION INIT_SECTION -#else -#define INIT_SECTION /* Done via alloc_text for MSC */ -#define INIT_FUNCTION INIT_SECTION -#endif - /* Enable debugging features */ #define GDI_DEBUG 0 #define DBG_ENABLE_GDIOBJ_BACKTRACES 0
5 years, 11 months
1
0
0
0
← Newer
1
2
3
4
5
6
7
...
33
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
Results per page:
10
25
50
100
200