github.com/primecitizens/pcz/std@v0.2.1/plat/js/webext/enterprise/reportingprivate/bindings/ffi_bindings.ts (about)

     1  import { importModule, Application, heap, Pointer } from "@ffi";
     2  
     3  importModule("plat/js/webext/enterprise/reportingprivate", (A: Application) => {
     4    const WEBEXT = typeof globalThis.browser === "undefined" ? globalThis.chrome : globalThis.browser;
     5  
     6    return {
     7      "constof_AntiVirusProductState": (ref: heap.Ref<string>): number => {
     8        const idx = ["ON", "OFF", "SNOOZED", "EXPIRED"].indexOf(A.H.get(ref));
     9        return idx < 0 ? 0 : idx + 1;
    10      },
    11  
    12      "store_AntiVirusSignal": (ptr: Pointer, ref: heap.Ref<any>) => {
    13        const x = A.H.get<any>(ref);
    14  
    15        if (typeof x === "undefined") {
    16          A.store.Bool(ptr + 12, false);
    17          A.store.Ref(ptr + 0, undefined);
    18          A.store.Ref(ptr + 4, undefined);
    19          A.store.Enum(ptr + 8, -1);
    20        } else {
    21          A.store.Bool(ptr + 12, true);
    22          A.store.Ref(ptr + 0, x["displayName"]);
    23          A.store.Ref(ptr + 4, x["productId"]);
    24          A.store.Enum(ptr + 8, ["ON", "OFF", "SNOOZED", "EXPIRED"].indexOf(x["state"] as string));
    25        }
    26      },
    27      "load_AntiVirusSignal": (ptr: Pointer, create: heap.Ref<boolean>, ref: heap.Ref<any>): heap.Ref<any> => {
    28        const x = create === A.H.TRUE ? {} : A.H.get<any>(ref);
    29  
    30        x["displayName"] = A.load.Ref(ptr + 0, undefined);
    31        x["productId"] = A.load.Ref(ptr + 4, undefined);
    32        x["state"] = A.load.Enum(ptr + 8, ["ON", "OFF", "SNOOZED", "EXPIRED"]);
    33        return create === A.H.TRUE ? A.H.push(x) : ref;
    34      },
    35      "constof_CertificateStatus": (ref: heap.Ref<string>): number => {
    36        const idx = ["OK", "POLICY_UNSET"].indexOf(A.H.get(ref));
    37        return idx < 0 ? 0 : idx + 1;
    38      },
    39  
    40      "store_Certificate": (ptr: Pointer, ref: heap.Ref<any>) => {
    41        const x = A.H.get<any>(ref);
    42  
    43        if (typeof x === "undefined") {
    44          A.store.Bool(ptr + 8, false);
    45          A.store.Enum(ptr + 0, -1);
    46          A.store.Ref(ptr + 4, undefined);
    47        } else {
    48          A.store.Bool(ptr + 8, true);
    49          A.store.Enum(ptr + 0, ["OK", "POLICY_UNSET"].indexOf(x["status"] as string));
    50          A.store.Ref(ptr + 4, x["encodedCertificate"]);
    51        }
    52      },
    53      "load_Certificate": (ptr: Pointer, create: heap.Ref<boolean>, ref: heap.Ref<any>): heap.Ref<any> => {
    54        const x = create === A.H.TRUE ? {} : A.H.get<any>(ref);
    55  
    56        x["status"] = A.load.Enum(ptr + 0, ["OK", "POLICY_UNSET"]);
    57        x["encodedCertificate"] = A.load.Ref(ptr + 4, undefined);
    58        return create === A.H.TRUE ? A.H.push(x) : ref;
    59      },
    60      "constof_RealtimeUrlCheckMode": (ref: heap.Ref<string>): number => {
    61        const idx = ["DISABLED", "ENABLED_MAIN_FRAME"].indexOf(A.H.get(ref));
    62        return idx < 0 ? 0 : idx + 1;
    63      },
    64      "constof_SafeBrowsingLevel": (ref: heap.Ref<string>): number => {
    65        const idx = ["DISABLED", "STANDARD", "ENHANCED"].indexOf(A.H.get(ref));
    66        return idx < 0 ? 0 : idx + 1;
    67      },
    68      "constof_PasswordProtectionTrigger": (ref: heap.Ref<string>): number => {
    69        const idx = ["PASSWORD_PROTECTION_OFF", "PASSWORD_REUSE", "PHISHING_REUSE", "POLICY_UNSET"].indexOf(A.H.get(ref));
    70        return idx < 0 ? 0 : idx + 1;
    71      },
    72      "constof_SettingValue": (ref: heap.Ref<string>): number => {
    73        const idx = ["UNKNOWN", "DISABLED", "ENABLED"].indexOf(A.H.get(ref));
    74        return idx < 0 ? 0 : idx + 1;
    75      },
    76  
    77      "store_ContextInfo": (ptr: Pointer, ref: heap.Ref<any>) => {
    78        const x = A.H.get<any>(ref);
    79  
    80        if (typeof x === "undefined") {
    81          A.store.Bool(ptr + 68, false);
    82          A.store.Ref(ptr + 0, undefined);
    83          A.store.Ref(ptr + 4, undefined);
    84          A.store.Ref(ptr + 8, undefined);
    85          A.store.Ref(ptr + 12, undefined);
    86          A.store.Ref(ptr + 16, undefined);
    87          A.store.Ref(ptr + 20, undefined);
    88          A.store.Enum(ptr + 24, -1);
    89          A.store.Ref(ptr + 28, undefined);
    90          A.store.Ref(ptr + 32, undefined);
    91          A.store.Enum(ptr + 36, -1);
    92          A.store.Bool(ptr + 64, false);
    93          A.store.Bool(ptr + 40, false);
    94          A.store.Bool(ptr + 65, false);
    95          A.store.Bool(ptr + 41, false);
    96          A.store.Enum(ptr + 44, -1);
    97          A.store.Bool(ptr + 66, false);
    98          A.store.Bool(ptr + 48, false);
    99          A.store.Bool(ptr + 67, false);
   100          A.store.Bool(ptr + 49, false);
   101          A.store.Enum(ptr + 52, -1);
   102          A.store.Ref(ptr + 56, undefined);
   103          A.store.Ref(ptr + 60, undefined);
   104        } else {
   105          A.store.Bool(ptr + 68, true);
   106          A.store.Ref(ptr + 0, x["browserAffiliationIds"]);
   107          A.store.Ref(ptr + 4, x["profileAffiliationIds"]);
   108          A.store.Ref(ptr + 8, x["onFileAttachedProviders"]);
   109          A.store.Ref(ptr + 12, x["onFileDownloadedProviders"]);
   110          A.store.Ref(ptr + 16, x["onBulkDataEntryProviders"]);
   111          A.store.Ref(ptr + 20, x["onPrintProviders"]);
   112          A.store.Enum(ptr + 24, ["DISABLED", "ENABLED_MAIN_FRAME"].indexOf(x["realtimeUrlCheckMode"] as string));
   113          A.store.Ref(ptr + 28, x["onSecurityEventProviders"]);
   114          A.store.Ref(ptr + 32, x["browserVersion"]);
   115          A.store.Enum(
   116            ptr + 36,
   117            ["DISABLED", "STANDARD", "ENHANCED"].indexOf(x["safeBrowsingProtectionLevel"] as string)
   118          );
   119          A.store.Bool(ptr + 64, "siteIsolationEnabled" in x ? true : false);
   120          A.store.Bool(ptr + 40, x["siteIsolationEnabled"] ? true : false);
   121          A.store.Bool(ptr + 65, "builtInDnsClientEnabled" in x ? true : false);
   122          A.store.Bool(ptr + 41, x["builtInDnsClientEnabled"] ? true : false);
   123          A.store.Enum(
   124            ptr + 44,
   125            ["PASSWORD_PROTECTION_OFF", "PASSWORD_REUSE", "PHISHING_REUSE", "POLICY_UNSET"].indexOf(
   126              x["passwordProtectionWarningTrigger"] as string
   127            )
   128          );
   129          A.store.Bool(ptr + 66, "chromeRemoteDesktopAppBlocked" in x ? true : false);
   130          A.store.Bool(ptr + 48, x["chromeRemoteDesktopAppBlocked"] ? true : false);
   131          A.store.Bool(ptr + 67, "thirdPartyBlockingEnabled" in x ? true : false);
   132          A.store.Bool(ptr + 49, x["thirdPartyBlockingEnabled"] ? true : false);
   133          A.store.Enum(ptr + 52, ["UNKNOWN", "DISABLED", "ENABLED"].indexOf(x["osFirewall"] as string));
   134          A.store.Ref(ptr + 56, x["systemDnsServers"]);
   135          A.store.Ref(ptr + 60, x["enterpriseProfileId"]);
   136        }
   137      },
   138      "load_ContextInfo": (ptr: Pointer, create: heap.Ref<boolean>, ref: heap.Ref<any>): heap.Ref<any> => {
   139        const x = create === A.H.TRUE ? {} : A.H.get<any>(ref);
   140  
   141        x["browserAffiliationIds"] = A.load.Ref(ptr + 0, undefined);
   142        x["profileAffiliationIds"] = A.load.Ref(ptr + 4, undefined);
   143        x["onFileAttachedProviders"] = A.load.Ref(ptr + 8, undefined);
   144        x["onFileDownloadedProviders"] = A.load.Ref(ptr + 12, undefined);
   145        x["onBulkDataEntryProviders"] = A.load.Ref(ptr + 16, undefined);
   146        x["onPrintProviders"] = A.load.Ref(ptr + 20, undefined);
   147        x["realtimeUrlCheckMode"] = A.load.Enum(ptr + 24, ["DISABLED", "ENABLED_MAIN_FRAME"]);
   148        x["onSecurityEventProviders"] = A.load.Ref(ptr + 28, undefined);
   149        x["browserVersion"] = A.load.Ref(ptr + 32, undefined);
   150        x["safeBrowsingProtectionLevel"] = A.load.Enum(ptr + 36, ["DISABLED", "STANDARD", "ENHANCED"]);
   151        if (A.load.Bool(ptr + 64)) {
   152          x["siteIsolationEnabled"] = A.load.Bool(ptr + 40);
   153        } else {
   154          delete x["siteIsolationEnabled"];
   155        }
   156        if (A.load.Bool(ptr + 65)) {
   157          x["builtInDnsClientEnabled"] = A.load.Bool(ptr + 41);
   158        } else {
   159          delete x["builtInDnsClientEnabled"];
   160        }
   161        x["passwordProtectionWarningTrigger"] = A.load.Enum(ptr + 44, [
   162          "PASSWORD_PROTECTION_OFF",
   163          "PASSWORD_REUSE",
   164          "PHISHING_REUSE",
   165          "POLICY_UNSET",
   166        ]);
   167        if (A.load.Bool(ptr + 66)) {
   168          x["chromeRemoteDesktopAppBlocked"] = A.load.Bool(ptr + 48);
   169        } else {
   170          delete x["chromeRemoteDesktopAppBlocked"];
   171        }
   172        if (A.load.Bool(ptr + 67)) {
   173          x["thirdPartyBlockingEnabled"] = A.load.Bool(ptr + 49);
   174        } else {
   175          delete x["thirdPartyBlockingEnabled"];
   176        }
   177        x["osFirewall"] = A.load.Enum(ptr + 52, ["UNKNOWN", "DISABLED", "ENABLED"]);
   178        x["systemDnsServers"] = A.load.Ref(ptr + 56, undefined);
   179        x["enterpriseProfileId"] = A.load.Ref(ptr + 60, undefined);
   180        return create === A.H.TRUE ? A.H.push(x) : ref;
   181      },
   182  
   183      "store_DeviceInfo": (ptr: Pointer, ref: heap.Ref<any>) => {
   184        const x = A.H.get<any>(ref);
   185  
   186        if (typeof x === "undefined") {
   187          A.store.Bool(ptr + 48, false);
   188          A.store.Ref(ptr + 0, undefined);
   189          A.store.Ref(ptr + 4, undefined);
   190          A.store.Ref(ptr + 8, undefined);
   191          A.store.Ref(ptr + 12, undefined);
   192          A.store.Ref(ptr + 16, undefined);
   193          A.store.Enum(ptr + 20, -1);
   194          A.store.Enum(ptr + 24, -1);
   195          A.store.Ref(ptr + 28, undefined);
   196          A.store.Ref(ptr + 32, undefined);
   197          A.store.Ref(ptr + 36, undefined);
   198          A.store.Ref(ptr + 40, undefined);
   199          A.store.Enum(ptr + 44, -1);
   200        } else {
   201          A.store.Bool(ptr + 48, true);
   202          A.store.Ref(ptr + 0, x["osName"]);
   203          A.store.Ref(ptr + 4, x["osVersion"]);
   204          A.store.Ref(ptr + 8, x["deviceHostName"]);
   205          A.store.Ref(ptr + 12, x["deviceModel"]);
   206          A.store.Ref(ptr + 16, x["serialNumber"]);
   207          A.store.Enum(ptr + 20, ["UNKNOWN", "DISABLED", "ENABLED"].indexOf(x["screenLockSecured"] as string));
   208          A.store.Enum(ptr + 24, ["UNKNOWN", "DISABLED", "ENABLED"].indexOf(x["diskEncrypted"] as string));
   209          A.store.Ref(ptr + 28, x["macAddresses"]);
   210          A.store.Ref(ptr + 32, x["windowsMachineDomain"]);
   211          A.store.Ref(ptr + 36, x["windowsUserDomain"]);
   212          A.store.Ref(ptr + 40, x["securityPatchLevel"]);
   213          A.store.Enum(ptr + 44, ["UNKNOWN", "DISABLED", "ENABLED"].indexOf(x["secureBootEnabled"] as string));
   214        }
   215      },
   216      "load_DeviceInfo": (ptr: Pointer, create: heap.Ref<boolean>, ref: heap.Ref<any>): heap.Ref<any> => {
   217        const x = create === A.H.TRUE ? {} : A.H.get<any>(ref);
   218  
   219        x["osName"] = A.load.Ref(ptr + 0, undefined);
   220        x["osVersion"] = A.load.Ref(ptr + 4, undefined);
   221        x["deviceHostName"] = A.load.Ref(ptr + 8, undefined);
   222        x["deviceModel"] = A.load.Ref(ptr + 12, undefined);
   223        x["serialNumber"] = A.load.Ref(ptr + 16, undefined);
   224        x["screenLockSecured"] = A.load.Enum(ptr + 20, ["UNKNOWN", "DISABLED", "ENABLED"]);
   225        x["diskEncrypted"] = A.load.Enum(ptr + 24, ["UNKNOWN", "DISABLED", "ENABLED"]);
   226        x["macAddresses"] = A.load.Ref(ptr + 28, undefined);
   227        x["windowsMachineDomain"] = A.load.Ref(ptr + 32, undefined);
   228        x["windowsUserDomain"] = A.load.Ref(ptr + 36, undefined);
   229        x["securityPatchLevel"] = A.load.Ref(ptr + 40, undefined);
   230        x["secureBootEnabled"] = A.load.Enum(ptr + 44, ["UNKNOWN", "DISABLED", "ENABLED"]);
   231        return create === A.H.TRUE ? A.H.push(x) : ref;
   232      },
   233      "constof_EventType": (ref: heap.Ref<string>): number => {
   234        const idx = ["DEVICE", "USER"].indexOf(A.H.get(ref));
   235        return idx < 0 ? 0 : idx + 1;
   236      },
   237  
   238      "store_EnqueueRecordRequest": (ptr: Pointer, ref: heap.Ref<any>) => {
   239        const x = A.H.get<any>(ref);
   240  
   241        if (typeof x === "undefined") {
   242          A.store.Bool(ptr + 13, false);
   243          A.store.Ref(ptr + 0, undefined);
   244          A.store.Bool(ptr + 12, false);
   245          A.store.Int32(ptr + 4, 0);
   246          A.store.Enum(ptr + 8, -1);
   247        } else {
   248          A.store.Bool(ptr + 13, true);
   249          A.store.Ref(ptr + 0, x["recordData"]);
   250          A.store.Bool(ptr + 12, "priority" in x ? true : false);
   251          A.store.Int32(ptr + 4, x["priority"] === undefined ? 0 : (x["priority"] as number));
   252          A.store.Enum(ptr + 8, ["DEVICE", "USER"].indexOf(x["eventType"] as string));
   253        }
   254      },
   255      "load_EnqueueRecordRequest": (ptr: Pointer, create: heap.Ref<boolean>, ref: heap.Ref<any>): heap.Ref<any> => {
   256        const x = create === A.H.TRUE ? {} : A.H.get<any>(ref);
   257  
   258        x["recordData"] = A.load.Ref(ptr + 0, undefined);
   259        if (A.load.Bool(ptr + 12)) {
   260          x["priority"] = A.load.Int32(ptr + 4);
   261        } else {
   262          delete x["priority"];
   263        }
   264        x["eventType"] = A.load.Enum(ptr + 8, ["DEVICE", "USER"]);
   265        return create === A.H.TRUE ? A.H.push(x) : ref;
   266      },
   267      "constof_PresenceValue": (ref: heap.Ref<string>): number => {
   268        const idx = ["UNSPECIFIED", "ACCESS_DENIED", "NOT_FOUND", "FOUND"].indexOf(A.H.get(ref));
   269        return idx < 0 ? 0 : idx + 1;
   270      },
   271  
   272      "store_GetFileSystemInfoResponse": (ptr: Pointer, ref: heap.Ref<any>) => {
   273        const x = A.H.get<any>(ref);
   274  
   275        if (typeof x === "undefined") {
   276          A.store.Bool(ptr + 29, false);
   277          A.store.Ref(ptr + 0, undefined);
   278          A.store.Enum(ptr + 4, -1);
   279          A.store.Ref(ptr + 8, undefined);
   280          A.store.Bool(ptr + 28, false);
   281          A.store.Bool(ptr + 12, false);
   282          A.store.Ref(ptr + 16, undefined);
   283          A.store.Ref(ptr + 20, undefined);
   284          A.store.Ref(ptr + 24, undefined);
   285        } else {
   286          A.store.Bool(ptr + 29, true);
   287          A.store.Ref(ptr + 0, x["path"]);
   288          A.store.Enum(ptr + 4, ["UNSPECIFIED", "ACCESS_DENIED", "NOT_FOUND", "FOUND"].indexOf(x["presence"] as string));
   289          A.store.Ref(ptr + 8, x["sha256Hash"]);
   290          A.store.Bool(ptr + 28, "isRunning" in x ? true : false);
   291          A.store.Bool(ptr + 12, x["isRunning"] ? true : false);
   292          A.store.Ref(ptr + 16, x["publicKeysHashes"]);
   293          A.store.Ref(ptr + 20, x["productName"]);
   294          A.store.Ref(ptr + 24, x["version"]);
   295        }
   296      },
   297      "load_GetFileSystemInfoResponse": (ptr: Pointer, create: heap.Ref<boolean>, ref: heap.Ref<any>): heap.Ref<any> => {
   298        const x = create === A.H.TRUE ? {} : A.H.get<any>(ref);
   299  
   300        x["path"] = A.load.Ref(ptr + 0, undefined);
   301        x["presence"] = A.load.Enum(ptr + 4, ["UNSPECIFIED", "ACCESS_DENIED", "NOT_FOUND", "FOUND"]);
   302        x["sha256Hash"] = A.load.Ref(ptr + 8, undefined);
   303        if (A.load.Bool(ptr + 28)) {
   304          x["isRunning"] = A.load.Bool(ptr + 12);
   305        } else {
   306          delete x["isRunning"];
   307        }
   308        x["publicKeysHashes"] = A.load.Ref(ptr + 16, undefined);
   309        x["productName"] = A.load.Ref(ptr + 20, undefined);
   310        x["version"] = A.load.Ref(ptr + 24, undefined);
   311        return create === A.H.TRUE ? A.H.push(x) : ref;
   312      },
   313  
   314      "store_GetFileSystemInfoOptions": (ptr: Pointer, ref: heap.Ref<any>) => {
   315        const x = A.H.get<any>(ref);
   316  
   317        if (typeof x === "undefined") {
   318          A.store.Bool(ptr + 8, false);
   319          A.store.Ref(ptr + 0, undefined);
   320          A.store.Bool(ptr + 6, false);
   321          A.store.Bool(ptr + 4, false);
   322          A.store.Bool(ptr + 7, false);
   323          A.store.Bool(ptr + 5, false);
   324        } else {
   325          A.store.Bool(ptr + 8, true);
   326          A.store.Ref(ptr + 0, x["path"]);
   327          A.store.Bool(ptr + 6, "computeSha256" in x ? true : false);
   328          A.store.Bool(ptr + 4, x["computeSha256"] ? true : false);
   329          A.store.Bool(ptr + 7, "computeExecutableMetadata" in x ? true : false);
   330          A.store.Bool(ptr + 5, x["computeExecutableMetadata"] ? true : false);
   331        }
   332      },
   333      "load_GetFileSystemInfoOptions": (ptr: Pointer, create: heap.Ref<boolean>, ref: heap.Ref<any>): heap.Ref<any> => {
   334        const x = create === A.H.TRUE ? {} : A.H.get<any>(ref);
   335  
   336        x["path"] = A.load.Ref(ptr + 0, undefined);
   337        if (A.load.Bool(ptr + 6)) {
   338          x["computeSha256"] = A.load.Bool(ptr + 4);
   339        } else {
   340          delete x["computeSha256"];
   341        }
   342        if (A.load.Bool(ptr + 7)) {
   343          x["computeExecutableMetadata"] = A.load.Bool(ptr + 5);
   344        } else {
   345          delete x["computeExecutableMetadata"];
   346        }
   347        return create === A.H.TRUE ? A.H.push(x) : ref;
   348      },
   349  
   350      "store_UserContext": (ptr: Pointer, ref: heap.Ref<any>) => {
   351        const x = A.H.get<any>(ref);
   352  
   353        if (typeof x === "undefined") {
   354          A.store.Bool(ptr + 4, false);
   355          A.store.Ref(ptr + 0, undefined);
   356        } else {
   357          A.store.Bool(ptr + 4, true);
   358          A.store.Ref(ptr + 0, x["userId"]);
   359        }
   360      },
   361      "load_UserContext": (ptr: Pointer, create: heap.Ref<boolean>, ref: heap.Ref<any>): heap.Ref<any> => {
   362        const x = create === A.H.TRUE ? {} : A.H.get<any>(ref);
   363  
   364        x["userId"] = A.load.Ref(ptr + 0, undefined);
   365        return create === A.H.TRUE ? A.H.push(x) : ref;
   366      },
   367  
   368      "store_GetFileSystemInfoRequest": (ptr: Pointer, ref: heap.Ref<any>) => {
   369        const x = A.H.get<any>(ref);
   370  
   371        if (typeof x === "undefined") {
   372          A.store.Bool(ptr + 12, false);
   373  
   374          A.store.Bool(ptr + 0 + 4, false);
   375          A.store.Ref(ptr + 0 + 0, undefined);
   376          A.store.Ref(ptr + 8, undefined);
   377        } else {
   378          A.store.Bool(ptr + 12, true);
   379  
   380          if (typeof x["userContext"] === "undefined") {
   381            A.store.Bool(ptr + 0 + 4, false);
   382            A.store.Ref(ptr + 0 + 0, undefined);
   383          } else {
   384            A.store.Bool(ptr + 0 + 4, true);
   385            A.store.Ref(ptr + 0 + 0, x["userContext"]["userId"]);
   386          }
   387          A.store.Ref(ptr + 8, x["options"]);
   388        }
   389      },
   390      "load_GetFileSystemInfoRequest": (ptr: Pointer, create: heap.Ref<boolean>, ref: heap.Ref<any>): heap.Ref<any> => {
   391        const x = create === A.H.TRUE ? {} : A.H.get<any>(ref);
   392  
   393        if (A.load.Bool(ptr + 0 + 4)) {
   394          x["userContext"] = {};
   395          x["userContext"]["userId"] = A.load.Ref(ptr + 0 + 0, undefined);
   396        } else {
   397          delete x["userContext"];
   398        }
   399        x["options"] = A.load.Ref(ptr + 8, undefined);
   400        return create === A.H.TRUE ? A.H.push(x) : ref;
   401      },
   402      "constof_RegistryHive": (ref: heap.Ref<string>): number => {
   403        const idx = ["HKEY_CLASSES_ROOT", "HKEY_LOCAL_MACHINE", "HKEY_CURRENT_USER"].indexOf(A.H.get(ref));
   404        return idx < 0 ? 0 : idx + 1;
   405      },
   406  
   407      "store_GetSettingsOptions": (ptr: Pointer, ref: heap.Ref<any>) => {
   408        const x = A.H.get<any>(ref);
   409  
   410        if (typeof x === "undefined") {
   411          A.store.Bool(ptr + 17, false);
   412          A.store.Ref(ptr + 0, undefined);
   413          A.store.Ref(ptr + 4, undefined);
   414          A.store.Bool(ptr + 16, false);
   415          A.store.Bool(ptr + 8, false);
   416          A.store.Enum(ptr + 12, -1);
   417        } else {
   418          A.store.Bool(ptr + 17, true);
   419          A.store.Ref(ptr + 0, x["path"]);
   420          A.store.Ref(ptr + 4, x["key"]);
   421          A.store.Bool(ptr + 16, "getValue" in x ? true : false);
   422          A.store.Bool(ptr + 8, x["getValue"] ? true : false);
   423          A.store.Enum(
   424            ptr + 12,
   425            ["HKEY_CLASSES_ROOT", "HKEY_LOCAL_MACHINE", "HKEY_CURRENT_USER"].indexOf(x["hive"] as string)
   426          );
   427        }
   428      },
   429      "load_GetSettingsOptions": (ptr: Pointer, create: heap.Ref<boolean>, ref: heap.Ref<any>): heap.Ref<any> => {
   430        const x = create === A.H.TRUE ? {} : A.H.get<any>(ref);
   431  
   432        x["path"] = A.load.Ref(ptr + 0, undefined);
   433        x["key"] = A.load.Ref(ptr + 4, undefined);
   434        if (A.load.Bool(ptr + 16)) {
   435          x["getValue"] = A.load.Bool(ptr + 8);
   436        } else {
   437          delete x["getValue"];
   438        }
   439        x["hive"] = A.load.Enum(ptr + 12, ["HKEY_CLASSES_ROOT", "HKEY_LOCAL_MACHINE", "HKEY_CURRENT_USER"]);
   440        return create === A.H.TRUE ? A.H.push(x) : ref;
   441      },
   442  
   443      "store_GetSettingsRequest": (ptr: Pointer, ref: heap.Ref<any>) => {
   444        const x = A.H.get<any>(ref);
   445  
   446        if (typeof x === "undefined") {
   447          A.store.Bool(ptr + 12, false);
   448  
   449          A.store.Bool(ptr + 0 + 4, false);
   450          A.store.Ref(ptr + 0 + 0, undefined);
   451          A.store.Ref(ptr + 8, undefined);
   452        } else {
   453          A.store.Bool(ptr + 12, true);
   454  
   455          if (typeof x["userContext"] === "undefined") {
   456            A.store.Bool(ptr + 0 + 4, false);
   457            A.store.Ref(ptr + 0 + 0, undefined);
   458          } else {
   459            A.store.Bool(ptr + 0 + 4, true);
   460            A.store.Ref(ptr + 0 + 0, x["userContext"]["userId"]);
   461          }
   462          A.store.Ref(ptr + 8, x["options"]);
   463        }
   464      },
   465      "load_GetSettingsRequest": (ptr: Pointer, create: heap.Ref<boolean>, ref: heap.Ref<any>): heap.Ref<any> => {
   466        const x = create === A.H.TRUE ? {} : A.H.get<any>(ref);
   467  
   468        if (A.load.Bool(ptr + 0 + 4)) {
   469          x["userContext"] = {};
   470          x["userContext"]["userId"] = A.load.Ref(ptr + 0 + 0, undefined);
   471        } else {
   472          delete x["userContext"];
   473        }
   474        x["options"] = A.load.Ref(ptr + 8, undefined);
   475        return create === A.H.TRUE ? A.H.push(x) : ref;
   476      },
   477  
   478      "store_GetSettingsResponse": (ptr: Pointer, ref: heap.Ref<any>) => {
   479        const x = A.H.get<any>(ref);
   480  
   481        if (typeof x === "undefined") {
   482          A.store.Bool(ptr + 20, false);
   483          A.store.Ref(ptr + 0, undefined);
   484          A.store.Ref(ptr + 4, undefined);
   485          A.store.Enum(ptr + 8, -1);
   486          A.store.Enum(ptr + 12, -1);
   487          A.store.Ref(ptr + 16, undefined);
   488        } else {
   489          A.store.Bool(ptr + 20, true);
   490          A.store.Ref(ptr + 0, x["path"]);
   491          A.store.Ref(ptr + 4, x["key"]);
   492          A.store.Enum(
   493            ptr + 8,
   494            ["HKEY_CLASSES_ROOT", "HKEY_LOCAL_MACHINE", "HKEY_CURRENT_USER"].indexOf(x["hive"] as string)
   495          );
   496          A.store.Enum(ptr + 12, ["UNSPECIFIED", "ACCESS_DENIED", "NOT_FOUND", "FOUND"].indexOf(x["presence"] as string));
   497          A.store.Ref(ptr + 16, x["value"]);
   498        }
   499      },
   500      "load_GetSettingsResponse": (ptr: Pointer, create: heap.Ref<boolean>, ref: heap.Ref<any>): heap.Ref<any> => {
   501        const x = create === A.H.TRUE ? {} : A.H.get<any>(ref);
   502  
   503        x["path"] = A.load.Ref(ptr + 0, undefined);
   504        x["key"] = A.load.Ref(ptr + 4, undefined);
   505        x["hive"] = A.load.Enum(ptr + 8, ["HKEY_CLASSES_ROOT", "HKEY_LOCAL_MACHINE", "HKEY_CURRENT_USER"]);
   506        x["presence"] = A.load.Enum(ptr + 12, ["UNSPECIFIED", "ACCESS_DENIED", "NOT_FOUND", "FOUND"]);
   507        x["value"] = A.load.Ref(ptr + 16, undefined);
   508        return create === A.H.TRUE ? A.H.push(x) : ref;
   509      },
   510  
   511      "store_HotfixSignal": (ptr: Pointer, ref: heap.Ref<any>) => {
   512        const x = A.H.get<any>(ref);
   513  
   514        if (typeof x === "undefined") {
   515          A.store.Bool(ptr + 4, false);
   516          A.store.Ref(ptr + 0, undefined);
   517        } else {
   518          A.store.Bool(ptr + 4, true);
   519          A.store.Ref(ptr + 0, x["hotfixId"]);
   520        }
   521      },
   522      "load_HotfixSignal": (ptr: Pointer, create: heap.Ref<boolean>, ref: heap.Ref<any>): heap.Ref<any> => {
   523        const x = create === A.H.TRUE ? {} : A.H.get<any>(ref);
   524  
   525        x["hotfixId"] = A.load.Ref(ptr + 0, undefined);
   526        return create === A.H.TRUE ? A.H.push(x) : ref;
   527      },
   528      "has_EnqueueRecord": (): heap.Ref<boolean> => {
   529        if (WEBEXT?.enterprise?.reportingPrivate && "enqueueRecord" in WEBEXT?.enterprise?.reportingPrivate) {
   530          return A.H.TRUE;
   531        }
   532        return A.H.FALSE;
   533      },
   534      "func_EnqueueRecord": (fn: Pointer): void => {
   535        A.store.Ref(fn, WEBEXT.enterprise.reportingPrivate.enqueueRecord);
   536      },
   537      "call_EnqueueRecord": (retPtr: Pointer, request: Pointer): void => {
   538        const request_ffi = {};
   539  
   540        request_ffi["recordData"] = A.load.Ref(request + 0, undefined);
   541        if (A.load.Bool(request + 12)) {
   542          request_ffi["priority"] = A.load.Int32(request + 4);
   543        }
   544        request_ffi["eventType"] = A.load.Enum(request + 8, ["DEVICE", "USER"]);
   545  
   546        const _ret = WEBEXT.enterprise.reportingPrivate.enqueueRecord(request_ffi);
   547        A.store.Ref(retPtr, _ret);
   548      },
   549      "try_EnqueueRecord": (retPtr: Pointer, errPtr: Pointer, request: Pointer): heap.Ref<boolean> => {
   550        try {
   551          const request_ffi = {};
   552  
   553          request_ffi["recordData"] = A.load.Ref(request + 0, undefined);
   554          if (A.load.Bool(request + 12)) {
   555            request_ffi["priority"] = A.load.Int32(request + 4);
   556          }
   557          request_ffi["eventType"] = A.load.Enum(request + 8, ["DEVICE", "USER"]);
   558  
   559          const _ret = WEBEXT.enterprise.reportingPrivate.enqueueRecord(request_ffi);
   560          A.store.Ref(retPtr, _ret);
   561          return A.H.TRUE;
   562        } catch (err: any) {
   563          A.store.Ref(errPtr, err);
   564          return A.H.FALSE;
   565        }
   566      },
   567      "has_GetAvInfo": (): heap.Ref<boolean> => {
   568        if (WEBEXT?.enterprise?.reportingPrivate && "getAvInfo" in WEBEXT?.enterprise?.reportingPrivate) {
   569          return A.H.TRUE;
   570        }
   571        return A.H.FALSE;
   572      },
   573      "func_GetAvInfo": (fn: Pointer): void => {
   574        A.store.Ref(fn, WEBEXT.enterprise.reportingPrivate.getAvInfo);
   575      },
   576      "call_GetAvInfo": (retPtr: Pointer, userContext: Pointer): void => {
   577        const userContext_ffi = {};
   578  
   579        userContext_ffi["userId"] = A.load.Ref(userContext + 0, undefined);
   580  
   581        const _ret = WEBEXT.enterprise.reportingPrivate.getAvInfo(userContext_ffi);
   582        A.store.Ref(retPtr, _ret);
   583      },
   584      "try_GetAvInfo": (retPtr: Pointer, errPtr: Pointer, userContext: Pointer): heap.Ref<boolean> => {
   585        try {
   586          const userContext_ffi = {};
   587  
   588          userContext_ffi["userId"] = A.load.Ref(userContext + 0, undefined);
   589  
   590          const _ret = WEBEXT.enterprise.reportingPrivate.getAvInfo(userContext_ffi);
   591          A.store.Ref(retPtr, _ret);
   592          return A.H.TRUE;
   593        } catch (err: any) {
   594          A.store.Ref(errPtr, err);
   595          return A.H.FALSE;
   596        }
   597      },
   598      "has_GetCertificate": (): heap.Ref<boolean> => {
   599        if (WEBEXT?.enterprise?.reportingPrivate && "getCertificate" in WEBEXT?.enterprise?.reportingPrivate) {
   600          return A.H.TRUE;
   601        }
   602        return A.H.FALSE;
   603      },
   604      "func_GetCertificate": (fn: Pointer): void => {
   605        A.store.Ref(fn, WEBEXT.enterprise.reportingPrivate.getCertificate);
   606      },
   607      "call_GetCertificate": (retPtr: Pointer, url: heap.Ref<object>): void => {
   608        const _ret = WEBEXT.enterprise.reportingPrivate.getCertificate(A.H.get<object>(url));
   609        A.store.Ref(retPtr, _ret);
   610      },
   611      "try_GetCertificate": (retPtr: Pointer, errPtr: Pointer, url: heap.Ref<object>): heap.Ref<boolean> => {
   612        try {
   613          const _ret = WEBEXT.enterprise.reportingPrivate.getCertificate(A.H.get<object>(url));
   614          A.store.Ref(retPtr, _ret);
   615          return A.H.TRUE;
   616        } catch (err: any) {
   617          A.store.Ref(errPtr, err);
   618          return A.H.FALSE;
   619        }
   620      },
   621      "has_GetContextInfo": (): heap.Ref<boolean> => {
   622        if (WEBEXT?.enterprise?.reportingPrivate && "getContextInfo" in WEBEXT?.enterprise?.reportingPrivate) {
   623          return A.H.TRUE;
   624        }
   625        return A.H.FALSE;
   626      },
   627      "func_GetContextInfo": (fn: Pointer): void => {
   628        A.store.Ref(fn, WEBEXT.enterprise.reportingPrivate.getContextInfo);
   629      },
   630      "call_GetContextInfo": (retPtr: Pointer): void => {
   631        const _ret = WEBEXT.enterprise.reportingPrivate.getContextInfo();
   632        A.store.Ref(retPtr, _ret);
   633      },
   634      "try_GetContextInfo": (retPtr: Pointer, errPtr: Pointer): heap.Ref<boolean> => {
   635        try {
   636          const _ret = WEBEXT.enterprise.reportingPrivate.getContextInfo();
   637          A.store.Ref(retPtr, _ret);
   638          return A.H.TRUE;
   639        } catch (err: any) {
   640          A.store.Ref(errPtr, err);
   641          return A.H.FALSE;
   642        }
   643      },
   644      "has_GetDeviceData": (): heap.Ref<boolean> => {
   645        if (WEBEXT?.enterprise?.reportingPrivate && "getDeviceData" in WEBEXT?.enterprise?.reportingPrivate) {
   646          return A.H.TRUE;
   647        }
   648        return A.H.FALSE;
   649      },
   650      "func_GetDeviceData": (fn: Pointer): void => {
   651        A.store.Ref(fn, WEBEXT.enterprise.reportingPrivate.getDeviceData);
   652      },
   653      "call_GetDeviceData": (retPtr: Pointer, id: heap.Ref<object>): void => {
   654        const _ret = WEBEXT.enterprise.reportingPrivate.getDeviceData(A.H.get<object>(id));
   655        A.store.Ref(retPtr, _ret);
   656      },
   657      "try_GetDeviceData": (retPtr: Pointer, errPtr: Pointer, id: heap.Ref<object>): heap.Ref<boolean> => {
   658        try {
   659          const _ret = WEBEXT.enterprise.reportingPrivate.getDeviceData(A.H.get<object>(id));
   660          A.store.Ref(retPtr, _ret);
   661          return A.H.TRUE;
   662        } catch (err: any) {
   663          A.store.Ref(errPtr, err);
   664          return A.H.FALSE;
   665        }
   666      },
   667      "has_GetDeviceId": (): heap.Ref<boolean> => {
   668        if (WEBEXT?.enterprise?.reportingPrivate && "getDeviceId" in WEBEXT?.enterprise?.reportingPrivate) {
   669          return A.H.TRUE;
   670        }
   671        return A.H.FALSE;
   672      },
   673      "func_GetDeviceId": (fn: Pointer): void => {
   674        A.store.Ref(fn, WEBEXT.enterprise.reportingPrivate.getDeviceId);
   675      },
   676      "call_GetDeviceId": (retPtr: Pointer): void => {
   677        const _ret = WEBEXT.enterprise.reportingPrivate.getDeviceId();
   678        A.store.Ref(retPtr, _ret);
   679      },
   680      "try_GetDeviceId": (retPtr: Pointer, errPtr: Pointer): heap.Ref<boolean> => {
   681        try {
   682          const _ret = WEBEXT.enterprise.reportingPrivate.getDeviceId();
   683          A.store.Ref(retPtr, _ret);
   684          return A.H.TRUE;
   685        } catch (err: any) {
   686          A.store.Ref(errPtr, err);
   687          return A.H.FALSE;
   688        }
   689      },
   690      "has_GetDeviceInfo": (): heap.Ref<boolean> => {
   691        if (WEBEXT?.enterprise?.reportingPrivate && "getDeviceInfo" in WEBEXT?.enterprise?.reportingPrivate) {
   692          return A.H.TRUE;
   693        }
   694        return A.H.FALSE;
   695      },
   696      "func_GetDeviceInfo": (fn: Pointer): void => {
   697        A.store.Ref(fn, WEBEXT.enterprise.reportingPrivate.getDeviceInfo);
   698      },
   699      "call_GetDeviceInfo": (retPtr: Pointer): void => {
   700        const _ret = WEBEXT.enterprise.reportingPrivate.getDeviceInfo();
   701        A.store.Ref(retPtr, _ret);
   702      },
   703      "try_GetDeviceInfo": (retPtr: Pointer, errPtr: Pointer): heap.Ref<boolean> => {
   704        try {
   705          const _ret = WEBEXT.enterprise.reportingPrivate.getDeviceInfo();
   706          A.store.Ref(retPtr, _ret);
   707          return A.H.TRUE;
   708        } catch (err: any) {
   709          A.store.Ref(errPtr, err);
   710          return A.H.FALSE;
   711        }
   712      },
   713      "has_GetFileSystemInfo": (): heap.Ref<boolean> => {
   714        if (WEBEXT?.enterprise?.reportingPrivate && "getFileSystemInfo" in WEBEXT?.enterprise?.reportingPrivate) {
   715          return A.H.TRUE;
   716        }
   717        return A.H.FALSE;
   718      },
   719      "func_GetFileSystemInfo": (fn: Pointer): void => {
   720        A.store.Ref(fn, WEBEXT.enterprise.reportingPrivate.getFileSystemInfo);
   721      },
   722      "call_GetFileSystemInfo": (retPtr: Pointer, request: Pointer): void => {
   723        const request_ffi = {};
   724  
   725        if (A.load.Bool(request + 0 + 4)) {
   726          request_ffi["userContext"] = {};
   727          request_ffi["userContext"]["userId"] = A.load.Ref(request + 0 + 0, undefined);
   728        }
   729        request_ffi["options"] = A.load.Ref(request + 8, undefined);
   730  
   731        const _ret = WEBEXT.enterprise.reportingPrivate.getFileSystemInfo(request_ffi);
   732        A.store.Ref(retPtr, _ret);
   733      },
   734      "try_GetFileSystemInfo": (retPtr: Pointer, errPtr: Pointer, request: Pointer): heap.Ref<boolean> => {
   735        try {
   736          const request_ffi = {};
   737  
   738          if (A.load.Bool(request + 0 + 4)) {
   739            request_ffi["userContext"] = {};
   740            request_ffi["userContext"]["userId"] = A.load.Ref(request + 0 + 0, undefined);
   741          }
   742          request_ffi["options"] = A.load.Ref(request + 8, undefined);
   743  
   744          const _ret = WEBEXT.enterprise.reportingPrivate.getFileSystemInfo(request_ffi);
   745          A.store.Ref(retPtr, _ret);
   746          return A.H.TRUE;
   747        } catch (err: any) {
   748          A.store.Ref(errPtr, err);
   749          return A.H.FALSE;
   750        }
   751      },
   752      "has_GetHotfixes": (): heap.Ref<boolean> => {
   753        if (WEBEXT?.enterprise?.reportingPrivate && "getHotfixes" in WEBEXT?.enterprise?.reportingPrivate) {
   754          return A.H.TRUE;
   755        }
   756        return A.H.FALSE;
   757      },
   758      "func_GetHotfixes": (fn: Pointer): void => {
   759        A.store.Ref(fn, WEBEXT.enterprise.reportingPrivate.getHotfixes);
   760      },
   761      "call_GetHotfixes": (retPtr: Pointer, userContext: Pointer): void => {
   762        const userContext_ffi = {};
   763  
   764        userContext_ffi["userId"] = A.load.Ref(userContext + 0, undefined);
   765  
   766        const _ret = WEBEXT.enterprise.reportingPrivate.getHotfixes(userContext_ffi);
   767        A.store.Ref(retPtr, _ret);
   768      },
   769      "try_GetHotfixes": (retPtr: Pointer, errPtr: Pointer, userContext: Pointer): heap.Ref<boolean> => {
   770        try {
   771          const userContext_ffi = {};
   772  
   773          userContext_ffi["userId"] = A.load.Ref(userContext + 0, undefined);
   774  
   775          const _ret = WEBEXT.enterprise.reportingPrivate.getHotfixes(userContext_ffi);
   776          A.store.Ref(retPtr, _ret);
   777          return A.H.TRUE;
   778        } catch (err: any) {
   779          A.store.Ref(errPtr, err);
   780          return A.H.FALSE;
   781        }
   782      },
   783      "has_GetPersistentSecret": (): heap.Ref<boolean> => {
   784        if (WEBEXT?.enterprise?.reportingPrivate && "getPersistentSecret" in WEBEXT?.enterprise?.reportingPrivate) {
   785          return A.H.TRUE;
   786        }
   787        return A.H.FALSE;
   788      },
   789      "func_GetPersistentSecret": (fn: Pointer): void => {
   790        A.store.Ref(fn, WEBEXT.enterprise.reportingPrivate.getPersistentSecret);
   791      },
   792      "call_GetPersistentSecret": (retPtr: Pointer, resetSecret: heap.Ref<boolean>): void => {
   793        const _ret = WEBEXT.enterprise.reportingPrivate.getPersistentSecret(resetSecret === A.H.TRUE);
   794        A.store.Ref(retPtr, _ret);
   795      },
   796      "try_GetPersistentSecret": (
   797        retPtr: Pointer,
   798        errPtr: Pointer,
   799        resetSecret: heap.Ref<boolean>
   800      ): heap.Ref<boolean> => {
   801        try {
   802          const _ret = WEBEXT.enterprise.reportingPrivate.getPersistentSecret(resetSecret === A.H.TRUE);
   803          A.store.Ref(retPtr, _ret);
   804          return A.H.TRUE;
   805        } catch (err: any) {
   806          A.store.Ref(errPtr, err);
   807          return A.H.FALSE;
   808        }
   809      },
   810      "has_GetSettings": (): heap.Ref<boolean> => {
   811        if (WEBEXT?.enterprise?.reportingPrivate && "getSettings" in WEBEXT?.enterprise?.reportingPrivate) {
   812          return A.H.TRUE;
   813        }
   814        return A.H.FALSE;
   815      },
   816      "func_GetSettings": (fn: Pointer): void => {
   817        A.store.Ref(fn, WEBEXT.enterprise.reportingPrivate.getSettings);
   818      },
   819      "call_GetSettings": (retPtr: Pointer, request: Pointer): void => {
   820        const request_ffi = {};
   821  
   822        if (A.load.Bool(request + 0 + 4)) {
   823          request_ffi["userContext"] = {};
   824          request_ffi["userContext"]["userId"] = A.load.Ref(request + 0 + 0, undefined);
   825        }
   826        request_ffi["options"] = A.load.Ref(request + 8, undefined);
   827  
   828        const _ret = WEBEXT.enterprise.reportingPrivate.getSettings(request_ffi);
   829        A.store.Ref(retPtr, _ret);
   830      },
   831      "try_GetSettings": (retPtr: Pointer, errPtr: Pointer, request: Pointer): heap.Ref<boolean> => {
   832        try {
   833          const request_ffi = {};
   834  
   835          if (A.load.Bool(request + 0 + 4)) {
   836            request_ffi["userContext"] = {};
   837            request_ffi["userContext"]["userId"] = A.load.Ref(request + 0 + 0, undefined);
   838          }
   839          request_ffi["options"] = A.load.Ref(request + 8, undefined);
   840  
   841          const _ret = WEBEXT.enterprise.reportingPrivate.getSettings(request_ffi);
   842          A.store.Ref(retPtr, _ret);
   843          return A.H.TRUE;
   844        } catch (err: any) {
   845          A.store.Ref(errPtr, err);
   846          return A.H.FALSE;
   847        }
   848      },
   849      "has_SetDeviceData": (): heap.Ref<boolean> => {
   850        if (WEBEXT?.enterprise?.reportingPrivate && "setDeviceData" in WEBEXT?.enterprise?.reportingPrivate) {
   851          return A.H.TRUE;
   852        }
   853        return A.H.FALSE;
   854      },
   855      "func_SetDeviceData": (fn: Pointer): void => {
   856        A.store.Ref(fn, WEBEXT.enterprise.reportingPrivate.setDeviceData);
   857      },
   858      "call_SetDeviceData": (retPtr: Pointer, id: heap.Ref<object>, data: heap.Ref<object>): void => {
   859        const _ret = WEBEXT.enterprise.reportingPrivate.setDeviceData(A.H.get<object>(id), A.H.get<object>(data));
   860        A.store.Ref(retPtr, _ret);
   861      },
   862      "try_SetDeviceData": (
   863        retPtr: Pointer,
   864        errPtr: Pointer,
   865        id: heap.Ref<object>,
   866        data: heap.Ref<object>
   867      ): heap.Ref<boolean> => {
   868        try {
   869          const _ret = WEBEXT.enterprise.reportingPrivate.setDeviceData(A.H.get<object>(id), A.H.get<object>(data));
   870          A.store.Ref(retPtr, _ret);
   871          return A.H.TRUE;
   872        } catch (err: any) {
   873          A.store.Ref(errPtr, err);
   874          return A.H.FALSE;
   875        }
   876      },
   877    };
   878  });