News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests
NB: Posting URL's See here: Posted URL Change

Main Menu

h2incx.exe and h2inc.exe to convert windows sdk headers? netfw.h and others??

Started by coffeeprog, August 07, 2021, 11:54:51 PM

Previous topic - Next topic

nidud


hutch--

I moved this topic to the Workshop to try and prevent long drawn out technical diswcussions in the Campus.

TouEnMasm

Here a sample in 32 bits (the sdk translate is 32/64 bits and need a minimal number of changes)
I have also added and modify two macros who made the code very similar to the c++ one
The grammatical (logic) question follow the same way as the original.
Headers in use are here http://luce.yves.pagesperso-orange.fr/header.htm


;################################################################
Get_FirewallSettings_PerProfileType PROC   ProfileTypePassed:NET_FW_PROFILE_TYPE2 ,ppvINetFwPolicy2:XMASM

local  bIsEnabled:VARIANT_BOOL,action:NET_FW_ACTION   ;VARIANT_BOOL TYPEDEF WORD ,NET_FW_ACTION TYPEDEF DWORD enum
.data
disabled db "disabled",0
enabled db "enabled",0
allow db "allow",0
block db "Block",0
.code
mov bIsEnabled,FALSE
;----------------------------------------------------------------------------------------

.if SUCCEEDED(INetFwPolicy2 get_FirewallEnabled,ProfileTypePassed,addr bIsEnabled)
invoke  printf,TXT("FirewallEnabled is %s",13,10),Q?(bIsEnabled,enabled,disabled)
.endif
;----------------------------------------------------------------------------------------
.if SUCCEEDED(INetFwPolicy2 get_BlockAllInboundTraffic,ProfileTypePassed, addr bIsEnabled )
invoke printf,TXT("Block all inbound traffic is %s ",13,10),Q?(bIsEnabled,enabled,disabled)
.endif
;----------------------------------------------------------------------------------------

.if SUCCEEDED(INetFwPolicy2  get_NotificationsDisabled,ProfileTypePassed,addr bIsEnabled)
invoke printf,TXT("Notifications are %s ",13,10),Q?(bIsEnabled,disabled,enabled)
.endif
;----------------------------------------------------------------------------------------

.if SUCCEEDED(INetFwPolicy2  get_UnicastResponsesToMulticastBroadcastDisabled,ProfileTypePassed, addr bIsEnabled);"disabled" : "enabled" <<<<<inverse
invoke printf,TXT("UnicastResponsesToMulticastBroadcast is %s",13,10),Q?(bIsEnabled,disabled,enabled)
.endif
;----------------------------------------------------------------------------------------

.if SUCCEEDED(INetFwPolicy2  get_DefaultInboundAction,ProfileTypePassed,addr action )
invoke printf,TXT("Default inbound action is %s ",13,10),Q?(action,allow,block)
.endif
;----------------------------------------------------------------------------------------

.if SUCCEEDED(INetFwPolicy2  get_DefaultOutboundAction,ProfileTypePassed,addr action)
invoke printf,TXT("Default outbound action is %s",13,10),Q?(action,allow,block)
.endif

ret
Get_FirewallSettings_PerProfileType endp



Fa is a musical note to play with CL