Author Topic: h2incx.exe and h2inc.exe to convert windows sdk headers? netfw.h and others??  (Read 3049 times)

nidud

  • Member
  • *****
  • Posts: 2388
    • https://github.com/nidud/asmc
deleted
« Last Edit: February 25, 2022, 01:26:52 AM by nidud »

hutch--

  • Administrator
  • Member
  • ******
  • Posts: 10583
  • Mnemonic Driven API Grinder
    • The MASM32 SDK
I moved this topic to the Workshop to try and prevent long drawn out technical diswcussions in the Campus.
hutch at movsd dot com
http://www.masm32.com    :biggrin:  :skrewy:

TouEnMasm

  • Member
  • *****
  • Posts: 1764
    • EditMasm
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

Code: [Select]
;################################################################
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