Skip to content

Commit

Permalink
Mark windows api nothrow @nogc (#17498)
Browse files Browse the repository at this point in the history
  • Loading branch information
0-v-0 authored Dec 11, 2024
1 parent 58a0ef7 commit 1fd2fdb
Show file tree
Hide file tree
Showing 19 changed files with 23 additions and 21 deletions.
10 changes: 5 additions & 5 deletions druntime/src/core/sys/windows/commctrl.d
Original file line number Diff line number Diff line change
Expand Up @@ -5014,7 +5014,7 @@ BOOL Animate_Seek(HWND hwnd, int frame) {
return Animate_Play(hwnd, frame, frame, 1);
}

extern (Windows) {
extern (Windows) nothrow @nogc {
HBITMAP CreateMappedBitmap(HINSTANCE, INT_PTR, UINT, LPCOLORMAP, int);
HWND CreateStatusWindowA(LONG, LPCSTR, HWND, UINT);
HWND CreateStatusWindowW(LONG, LPCWSTR, HWND, UINT);
Expand Down Expand Up @@ -5068,7 +5068,7 @@ BOOL DateTime_SetSystemtime(HWND hwnd, WPARAM flag, LPSYSTEMTIME lpSysTime) {
cast(LPARAM) lpSysTime);
}

extern (Windows) {
extern (Windows) nothrow @nogc {
void DrawInsert(HWND, HWND, int);
void DrawStatusTextA(HDC, LPRECT, LPCSTR, UINT);
void DrawStatusTextW(HDC, LPRECT, LPCWSTR, UINT);
Expand Down Expand Up @@ -5142,7 +5142,7 @@ static if (_WIN32_IE >= 0x400) {
}
}

extern (Windows) {
extern (Windows) nothrow @nogc {
HDSA DSA_Create(INT, INT);
BOOL DSA_Destroy(HDSA);
VOID DSA_DestroyCallback(HDSA, PFNDSAENUMCALLBACK, PVOID);
Expand Down Expand Up @@ -5758,7 +5758,7 @@ BOOL MonthCal_SetRange(HWND w, DWORD f, LPSYSTEMTIME st) {
cast(LPARAM) st);
}

extern (Windows) BOOL ShowHideMenuCtl(HWND, UINT_PTR, PINT);
extern (Windows) nothrow @nogc BOOL ShowHideMenuCtl(HWND, UINT_PTR, PINT);

BOOL TabCtrl_GetItem(HWND w, int i, LPTCITEM p) {
return cast(BOOL) SendMessage(w, TCM_GETITEM, i, cast(LPARAM) p);
Expand Down Expand Up @@ -6069,7 +6069,7 @@ static if (_WIN32_IE >= 0x300) {
return cast(BOOL) SendMessage(w, LVM_SETITEMCOUNT, i, cast(LPARAM) f);
}

extern (Windows) {
extern (Windows) nothrow @nogc {
WINBOOL ImageList_SetImageCount(HIMAGELIST, UINT);
WINBOOL ImageList_Copy(HIMAGELIST, int, HIMAGELIST, int, UINT);
WINBOOL ImageList_DrawIndirect(IMAGELISTDRAWPARAMS*);
Expand Down
1 change: 1 addition & 0 deletions druntime/src/core/sys/windows/custcntl.d
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ extern (Windows) {
alias INT function(DWORD, DWORD, HFONT, LPWSTR) LPFNCCSIZETOTEXTW;
alias UINT function(LPCCINFOA) LPFNCCINFOA;
alias UINT function(LPCCINFOW) LPFNCCINFOW;
nothrow @nogc:
UINT CustomControlInfoA(LPCCINFOA acci);
UINT CustomControlInfoW(LPCCINFOW acci);
}
Expand Down
2 changes: 1 addition & 1 deletion druntime/src/core/sys/windows/dde.d
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ deprecated struct DDEUP {
@property bool fAckReq(bool f) { _bf = cast(ushort) ((_bf & ~0x8000) | (f << 15)); return f; }
}

extern (Windows) {
extern (Windows) nothrow @nogc {
BOOL DdeSetQualityOfService(HWND, const(SECURITY_QUALITY_OF_SERVICE)*,
PSECURITY_QUALITY_OF_SERVICE);
BOOL ImpersonateDdeClientWindow(HWND, HWND);
Expand Down
2 changes: 1 addition & 1 deletion druntime/src/core/sys/windows/ddeml.d
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,7 @@ struct MONMSGSTRUCT {
}
alias MONMSGSTRUCT* PMONMSGSTRUCT;

extern (Windows) {
extern (Windows) nothrow @nogc {
BOOL DdeAbandonTransaction(DWORD, HCONV, DWORD);
PBYTE DdeAccessData(HDDEDATA, PDWORD);
HDDEDATA DdeAddData(HDDEDATA, PBYTE, DWORD, DWORD);
Expand Down
2 changes: 1 addition & 1 deletion druntime/src/core/sys/windows/dhcpcsdk.d
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ struct DHCPCAPI_PARAMS_ARRAY {
}
alias DHCPCAPI_PARAMS_ARRAY* PDHCPCAPI_PARAMS_ARRAY, LPDHCPCAPI_PARAMS_ARRAY;

extern (Windows) {
extern (Windows) nothrow @nogc {
void DhcpCApiCleanup();
DWORD DhcpCApiInitialize(LPDWORD);
DWORD DhcpDeRegisterParamChange(DWORD, LPVOID, LPVOID);
Expand Down
2 changes: 1 addition & 1 deletion druntime/src/core/sys/windows/errorrep.d
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ enum EFaultRepRetVal {
frrvOkHeadless // = 7
}

extern (Windows) {
extern (Windows) nothrow @nogc {
BOOL AddERExcludedApplicationA(LPCSTR);
BOOL AddERExcludedApplicationW(LPCWSTR);
EFaultRepRetVal ReportFault(LPEXCEPTION_POINTERS, DWORD);
Expand Down
1 change: 1 addition & 0 deletions druntime/src/core/sys/windows/imagehlp.d
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,7 @@ extern (Windows) {
alias BOOL function(DIGEST_HANDLE refdata, PBYTE pData, DWORD dwLength)
DIGEST_FUNCTION;

nothrow @nogc:
PIMAGE_NT_HEADERS CheckSumMappedFile(LPVOID, DWORD, LPDWORD, LPDWORD);
DWORD MapFileAndCheckSumA(LPSTR, LPDWORD, LPDWORD);
DWORD MapFileAndCheckSumW(PWSTR, LPDWORD, LPDWORD);
Expand Down
2 changes: 1 addition & 1 deletion druntime/src/core/sys/windows/intshcut.d
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ interface IUniformResourceLocator : IUnknown {
alias IUniformResourceLocator PIUniformResourceLocator,
PCIUniformResourceLocator;

extern (Windows) {
extern (Windows) nothrow @nogc {
BOOL InetIsOffline(DWORD);
HRESULT MIMEAssociationDialogA(HWND, DWORD, PCSTR, PCSTR, PSTR, UINT);
HRESULT MIMEAssociationDialogW(HWND, DWORD, PCWSTR, PCWSTR, PWSTR, UINT);
Expand Down
2 changes: 1 addition & 1 deletion druntime/src/core/sys/windows/iphlpapi.d
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ version (Windows):
import core.sys.windows.ipexport, core.sys.windows.iprtrmib, core.sys.windows.iptypes;
import core.sys.windows.winbase, core.sys.windows.windef;

extern (Windows) {
extern (Windows) nothrow @nogc {
DWORD AddIPAddress(IPAddr, IPMask, DWORD, PULONG, PULONG);
DWORD CreateIpForwardEntry(PMIB_IPFORWARDROW);
DWORD CreateIpNetEntry(PMIB_IPNETROW);
Expand Down
2 changes: 1 addition & 1 deletion druntime/src/core/sys/windows/lmaccess.d
Original file line number Diff line number Diff line change
Expand Up @@ -708,7 +708,7 @@ struct NETLOGON_INFO_3{
}
alias NETLOGON_INFO_3* PNETLOGON_INFO_3;

extern (Windows) {
extern (Windows) nothrow @nogc {
deprecated {
/* These are obsolete */
NET_API_STATUS NetAccessAdd(LPCWSTR,DWORD,PBYTE,PDWORD);
Expand Down
2 changes: 1 addition & 1 deletion druntime/src/core/sys/windows/lmalert.d
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ struct USER_OTHER_INFO{
}
alias USER_OTHER_INFO* PUSER_OTHER_INFO, LPUSER_OTHER_INFO;

extern (Windows) {
extern (Windows) nothrow @nogc {
NET_API_STATUS NetAlertRaise(LPCWSTR,PVOID,DWORD);
NET_API_STATUS NetAlertRaiseEx(LPCWSTR,PVOID,DWORD,LPCWSTR);
}
2 changes: 1 addition & 1 deletion druntime/src/core/sys/windows/lmapibuf.d
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ pragma(lib, "netapi32");

import core.sys.windows.lmcons, core.sys.windows.windef;

extern (Windows) {
extern (Windows) nothrow @nogc {
NET_API_STATUS NetApiBufferAllocate(DWORD, PVOID*);
NET_API_STATUS NetApiBufferFree(PVOID);
NET_API_STATUS NetApiBufferReallocate(PVOID, DWORD, PVOID*);
Expand Down
2 changes: 1 addition & 1 deletion druntime/src/core/sys/windows/lmmsg.d
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ struct MSG_INFO_1 {
}
alias MSG_INFO_1* PMSG_INFO_1, LPMSG_INFO_1;

extern (Windows) {
extern (Windows) nothrow @nogc {
NET_API_STATUS NetMessageBufferSend(LPCWSTR, LPCWSTR, LPCWSTR, PBYTE,
DWORD);
NET_API_STATUS NetMessageNameAdd(LPCWSTR, LPCWSTR);
Expand Down
2 changes: 1 addition & 1 deletion druntime/src/core/sys/windows/lmremutl.d
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ struct TIME_OF_DAY_INFO {
}
alias TIME_OF_DAY_INFO* PTIME_OF_DAY_INFO, LPTIME_OF_DAY_INFO;

extern (Windows) {
extern (Windows) nothrow @nogc {
NET_API_STATUS NetRemoteTOD(LPCWSTR, PBYTE*);
NET_API_STATUS NetRemoteComputerSupports(LPCWSTR, DWORD, PDWORD);
NET_API_STATUS RxRemoteApi(DWORD, LPCWSTR, LPDESC, LPDESC, LPDESC,
Expand Down
2 changes: 1 addition & 1 deletion druntime/src/core/sys/windows/mgmtapi.d
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ enum MGMCTL_SETAGENTPORT = 1;

alias PVOID LPSNMP_MGR_SESSION;

extern (Windows) {
extern (Windows) nothrow @nogc {
BOOL SnmpMgrClose(LPSNMP_MGR_SESSION);
BOOL SnmpMgrCtl(LPSNMP_MGR_SESSION, DWORD, LPVOID, DWORD, LPVOID, DWORD,
LPDWORD);
Expand Down
2 changes: 1 addition & 1 deletion druntime/src/core/sys/windows/ntdll.d
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ enum SHUTDOWN_ACTION {
ShutdownPowerOff
}

extern (Windows) uint NtShutdownSystem(SHUTDOWN_ACTION Action);
extern (Windows) nothrow @nogc uint NtShutdownSystem(SHUTDOWN_ACTION Action);
2 changes: 1 addition & 1 deletion druntime/src/core/sys/windows/ntsecapi.d
Original file line number Diff line number Diff line change
Expand Up @@ -726,7 +726,7 @@ struct TRUSTED_DOMAIN_FULL_INFORMATION {
}
alias TRUSTED_DOMAIN_FULL_INFORMATION* PTRUSTED_DOMAIN_FULL_INFORMATION;

extern (Windows) {
extern (Windows) nothrow @nogc {
NTSTATUS LsaAddAccountRights(LSA_HANDLE, PSID, PLSA_UNICODE_STRING,
ULONG);
NTSTATUS LsaCallAuthenticationPackage(HANDLE, ULONG, PVOID, ULONG,
Expand Down
2 changes: 1 addition & 1 deletion druntime/src/core/sys/windows/prsht.d
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,7 @@ struct PSHNOTIFY {
}
alias PSHNOTIFY* LPPSHNOTIFY;

extern (Windows) {
extern (Windows) nothrow @nogc {
HPROPSHEETPAGE CreatePropertySheetPageA(LPCPROPSHEETPAGEA);
HPROPSHEETPAGE CreatePropertySheetPageW(LPCPROPSHEETPAGEW);
BOOL DestroyPropertySheetPage(HPROPSHEETPAGE);
Expand Down
2 changes: 1 addition & 1 deletion druntime/src/core/sys/windows/rpc.d
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,6 @@ public import core.sys.windows.winerror;
alias MIDL_user_allocate midl_user_allocate;
alias MIDL_user_free midl_user_free;

extern (Windows) {
extern (Windows) nothrow @nogc {
int I_RpcMapWin32Status(RPC_STATUS);
}

0 comments on commit 1fd2fdb

Please sign in to comment.