@@ -667,7 +667,7 @@ BOOLEAN _wfp_transact_commit (
667667
668668BOOLEAN _wfp_deletefilter (
669669 _In_ HANDLE engine_handle ,
670- _In_ LPGUID filter_id
670+ _In_ LPCGUID filter_id
671671)
672672{
673673 PR_STRING string ;
@@ -1021,7 +1021,7 @@ BOOLEAN _wfp_createrulefilter (
10211021
10221022 if (!ptr_app )
10231023 {
1024- _r_log_v (LOG_LEVEL_WARNING , NULL , TEXT (__FUNCTION__ ), 0 , L"App \"%" TEXT (PR_ULONG ) L"\" was not found!" , app_hash );
1024+ _r_log_v (LOG_LEVEL_WARNING , NULL , TEXT (__FUNCTION__ ), STATUS_OBJECT_PATH_NOT_FOUND , L"App \"%" TEXT (PR_ULONG ) L"\" was not found!" , app_hash );
10251025
10261026 goto CleanupExit ;
10271027 }
@@ -1030,7 +1030,7 @@ BOOLEAN _wfp_createrulefilter (
10301030 {
10311031 if (ptr_app -> bytes )
10321032 {
1033- ByteBlobAlloc (ptr_app -> bytes -> buffer , RtlLengthSecurityDescriptor (ptr_app -> bytes -> buffer ), ( PVOID_PTR ) & byte_blob );
1033+ ByteBlobAlloc (( PVOID_PTR ) & byte_blob , ptr_app -> bytes -> buffer , RtlLengthSecurityDescriptor (ptr_app -> bytes -> buffer ));
10341034
10351035 fwfc [count ].fieldKey = FWPM_CONDITION_ALE_USER_ID ;
10361036 fwfc [count ].matchType = FWP_MATCH_EQUAL ;
@@ -1041,7 +1041,7 @@ BOOLEAN _wfp_createrulefilter (
10411041 }
10421042 else
10431043 {
1044- _r_log (LOG_LEVEL_ERROR , NULL , TEXT (__FUNCTION__ ), 0 , _r_obj_getstring (ptr_app -> original_path ));
1044+ _r_log (LOG_LEVEL_ERROR , NULL , TEXT (__FUNCTION__ ), STATUS_OBJECT_PATH_NOT_FOUND , _r_obj_getstring (ptr_app -> original_path ));
10451045
10461046 goto CleanupExit ;
10471047 }
@@ -1059,14 +1059,14 @@ BOOLEAN _wfp_createrulefilter (
10591059 }
10601060 else
10611061 {
1062- _r_log (LOG_LEVEL_ERROR , NULL , TEXT (__FUNCTION__ ), 0 , _r_obj_getstring (ptr_app -> original_path ));
1062+ _r_log (LOG_LEVEL_ERROR , NULL , TEXT (__FUNCTION__ ), STATUS_OBJECT_PATH_NOT_FOUND , _r_obj_getstring (ptr_app -> original_path ));
10631063
10641064 goto CleanupExit ;
10651065 }
10661066 }
10671067 else
10681068 {
1069- status = _FwpmGetAppIdFromFileName1 (ptr_app -> original_path , ptr_app -> type , ( PVOID_PTR ) & byte_blob );
1069+ status = _FwpmGetAppIdFromFileName1 (( PVOID_PTR ) & byte_blob , ptr_app -> original_path , ptr_app -> type );
10701070
10711071 if (NT_SUCCESS (status ))
10721072 {
@@ -1384,23 +1384,23 @@ BOOLEAN _wfp_create4filters (
13841384 R_STRINGREF local_remaining_part ;
13851385 R_STRINGREF rule_remote_part ;
13861386 R_STRINGREF rule_local_part ;
1387+ PITEM_RULE ptr_rule ;
13871388 LPCWSTR rule_name ;
13881389 PR_ARRAY guids ;
1389- LPGUID guid ;
1390- PITEM_RULE ptr_rule ;
1390+ LPCGUID guid ;
13911391 ULONG_PTR enum_key ;
13921392 ULONG hash_code ;
13931393 BOOLEAN is_enabled ;
13941394
1395- if (_r_obj_isempty (rules ))
1395+ if (_r_obj_isempty2 (rules ))
13961396 return FALSE;
13971397
13981398 is_enabled = _app_initinterfacestate (_r_app_gethwnd (), FALSE);
13991399
14001400 if (!is_intransact && _wfp_isfiltersapplying ())
14011401 is_intransact = TRUE;
14021402
1403- guids = _r_obj_createarray (sizeof (GUID ), 10 , NULL );
1403+ guids = _r_obj_createarray (sizeof (GUID ), 0x10 , NULL );
14041404
14051405 if (!is_intransact )
14061406 {
@@ -1421,7 +1421,7 @@ BOOLEAN _wfp_create4filters (
14211421
14221422 for (ULONG_PTR i = 0 ; i < _r_obj_getarraysize (guids ); i ++ )
14231423 {
1424- guid = (LPGUID )_r_obj_getarrayitem (guids , i );
1424+ guid = (LPCGUID )_r_obj_getarrayitem (guids , i );
14251425
14261426 if (guid )
14271427 _app_setfiltersecurity (engine_handle , guid , FALSE, DBG_ARG_VAR );
@@ -1434,7 +1434,7 @@ BOOLEAN _wfp_create4filters (
14341434
14351435 for (ULONG_PTR i = 0 ; i < _r_obj_getarraysize (guids ); i ++ )
14361436 {
1437- guid = (LPGUID )_r_obj_getarrayitem (guids , i );
1437+ guid = (LPCGUID )_r_obj_getarrayitem (guids , i );
14381438
14391439 if (guid )
14401440 _wfp_deletefilter (engine_handle , guid );
@@ -2766,9 +2766,9 @@ BOOLEAN _wfp_firewallisenabled ()
27662766
27672767_Success_ (NT_SUCCESS (return ))
27682768NTSTATUS _FwpmGetAppIdFromFileName1 (
2769+ _Out_ PVOID_PTR byte_blob ,
27692770 _In_ PR_STRING path ,
2770- _In_ ENUM_TYPE_DATA type ,
2771- _Out_ PVOID_PTR byte_blob
2771+ _In_ ENUM_TYPE_DATA type
27722772)
27732773{
27742774 R_STRINGREF path_skip_root ;
@@ -2782,7 +2782,7 @@ NTSTATUS _FwpmGetAppIdFromFileName1 (
27822782 {
27832783 if (_r_str_gethash (& path -> sr , TRUE) == config .ntoskrnl_hash )
27842784 {
2785- ByteBlobAlloc (path -> buffer , path -> length + sizeof (UNICODE_NULL ), byte_blob );
2785+ ByteBlobAlloc (byte_blob , path -> buffer , path -> length + sizeof (UNICODE_NULL ));
27862786
27872787 return STATUS_SUCCESS ;
27882788 }
@@ -2834,7 +2834,7 @@ NTSTATUS _FwpmGetAppIdFromFileName1 (
28342834 }
28352835 }
28362836
2837- ByteBlobAlloc (original_path -> buffer , original_path -> length + sizeof (UNICODE_NULL ), byte_blob );
2837+ ByteBlobAlloc (byte_blob , original_path -> buffer , original_path -> length + sizeof (UNICODE_NULL ));
28382838
28392839 _r_obj_dereference (original_path );
28402840
@@ -2848,7 +2848,7 @@ NTSTATUS _FwpmGetAppIdFromFileName1 (
28482848 if (type == DATA_APP_DEVICE )
28492849 _r_str_tolower (& original_path -> sr ); // lower is important!
28502850
2851- ByteBlobAlloc (original_path -> buffer , original_path -> length + sizeof (UNICODE_NULL ), byte_blob );
2851+ ByteBlobAlloc (byte_blob , original_path -> buffer , original_path -> length + sizeof (UNICODE_NULL ));
28522852
28532853 _r_obj_dereference (original_path );
28542854
@@ -2859,16 +2859,16 @@ NTSTATUS _FwpmGetAppIdFromFileName1 (
28592859}
28602860
28612861VOID ByteBlobAlloc (
2862+ _Out_ PVOID_PTR byte_blob ,
28622863 _In_ LPCVOID data ,
2863- _In_ ULONG_PTR bytes_count ,
2864- _Out_ PVOID_PTR byte_blob
2864+ _In_ ULONG_PTR bytes_count
28652865)
28662866{
28672867 FWP_BYTE_BLOB * blob ;
28682868
28692869 blob = _r_mem_allocate (sizeof (FWP_BYTE_BLOB ) + bytes_count );
28702870
2871- blob -> size = (UINT )(UINT_PTR )bytes_count ;
2871+ blob -> size = (UINT32 )(UINT_PTR )bytes_count ;
28722872 blob -> data = PTR_ADD_OFFSET (blob , sizeof (FWP_BYTE_BLOB ));
28732873
28742874 RtlCopyMemory (blob -> data , data , bytes_count );
0 commit comments