text
stringlengths
14
100k
source
stringclasses
1 value
repo
stringclasses
810 values
language
stringclasses
13 values
<|fim_prefix|>package com.williamfiset.algorithms.dp; import static com.google.common.truth.Truth.assertThat; import java.util.*; import org.junit.jupiter.api.*; public class WeightedMaximumCardinalityMatchingTest { static final int LOOPS = 50; static final double INF = 987654321.0; static class BruteForceMw...
fim
williamfiset/algorithms
java
<|fim_suffix|>= new Point2D.Double(1, 0); pts[8] = new Point2D.Double(5, 0); // In hull pts[9] = new Point2D.Double(-1, -1); pts[10] = new Point2D.Double(0, -1); pts[11] = new Point2D.Double(1, -1); pts[12] = new Point2D.Double(0, -5); // In hull // Duplicate point on hull. pts[13] = new Po...
fim
williamfiset/algorithms
java
package com.williamfiset.algorithms.geometry; import static com.google.common.truth.Truth.assertThat; import java.awt.geom.*; import org.junit.jupiter.api.*; public class MinimumCostConvexPolygonTriangulationTest { private static final double TOLERANCE = 1e-3; @Test public void MinimumCostConvexPolygonTriang...
fim
williamfiset/algorithms
java
package com.williamfiset.algorithms.graphtheory; import static com.google.common.truth.Truth.assertThat; import java.util.*; import org.junit.jupiter.api.*; public class ArticulationPointsAdjacencyListTest { // Initialize graph with 'n' nodes. public static List<List<Integer>> createGraph(int n) { List<List...
fim
williamfiset/algorithms
java
<|fim_suffix|>manFord(g, V, 0); assertThat(dist[0]).isEqualTo(0.0); assertThat(dist[1]).isEqualTo(1.0); assertThat(dist[2]).isNegativeInfinity(); assertThat(dist[3]).isNegativeInfinity(); assertThat(dist[4]).isNegativeInfinity(); assertThat(dist[5]).isEqualTo(5.0); assertThat(dist[6]).isEqu...
fim
williamfiset/algorithms
java
<|fim_suffix|>get(0).u); connected.add(mst.get(0).v); boolean changed = true; while (changed) { changed = false; for (Edge e : mst) { if (connected.contains(e.u) && !connected.contains(e.v)) { connected.add(e.v); changed = true; } else if (connected.contains(...
fim
williamfiset/algorithms
java
<|fim_prefix|>package com.williamfiset.algorithms.graphtheory; import static com.google.common.truth.Truth.assertThat; import static com.williamfiset.algorithms.graphtheory.BreadthFirstSearchAdjacencyList.Edge; import static com.williamfiset.algorithms.graphtheory.BreadthFirstSearchAdjacencyList.addUndirectedEdge; imp...
fim
williamfiset/algorithms
java
<|fim_prefix|>package com.williamfiset.algorithms.graphtheory; import static com.google.common.truth.Truth.assertThat; import com.google.common.collect.ImmutableList; import java.util.*; import org.apache.commons.lang3.tuple.Pair; import org.junit.jupiter.api.*; public class BridgesAdjacencyListTest { // Initiali...
fim
williamfiset/algorithms
java
<|fim_suffix|>er> roots = new HashSet<>(); roots.add(solver.componentId(0)); roots.add(solver.componentId(3)); roots.add(solver.componentId(5)); roots.add(solver.componentId(7)); roots.add(solver.componentId(10)); assertThat(roots).hasSize(5); // Component sizes. assertThat(solver.compo...
fim
williamfiset/algorithms
java
<|fim_suffix|>); assertThat(path).containsExactly(0, 1, 2, 3, 4).inOrder(); } @Test public void disconnectedGraph() { DijkstrasShortestPathAdjacencyList solver = new DijkstrasShortestPathAdjacencyList(4); solver.addEdge(0, 1, 3); solver.addEdge(2, 3, 1); assertThat(solver.dijkstra(0, 1)).isE...
fim
williamfiset/algorithms
java
<|fim_prefix|>package com.williamfiset.algorithms.graphtheory; import static com.google.common.truth.Truth.assertThat; import java.util.List; import org.junit.jupiter.api.Test; public class DijkstrasShortestPathAdjacencyListWithDHeapTest { @Test public void singleNode() { DijkstrasShortestPathAdjacencyListW...
fim
williamfiset/algorithms
java
<|fim_prefix|>package com.williamfiset.algorithms.graphtheory; import static com.google.common.truth.Truth.assertThat; import static org.junit.jupiter.api.Assertions.assertThrows; import com.williamfiset.algorithms.graphtheory.EagerPrimsAdjacencyList.Edge; import java.util.*; import org.junit.jupiter.api.*; public c...
fim
williamfiset/algorithms
java
package com.williamfiset.algorithms.graphtheory; import static com.google.common.truth.Truth.assertThat; import java.util.*; import org.junit.jupiter.api.*; public class EulerianPathDirectedEdgesAdjacencyListTest { EulerianPathDirectedEdgesAdjacencyList solver; @BeforeEach public void setUp() { solver = ...
fim
williamfiset/algorithms
java
<|fim_prefix|>package com.williamfiset.algorithms.graphtheory; import static com.google.common.truth.Truth.assertThat; import com.williamfiset.algorithms.graphtheory.BellmanFordEdgeList.Edge; import java.util.*; import org.junit.jupiter.api.*; public class FloydWarshallSolverTest { static final double INF = Doubl...
fim
williamfiset/algorithms
java
<|fim_suffix|>IllegalArgumentException.class, () -> solver.kahns(g)); } @Test public void verifyIsTopsortOrdering() { List<List<Integer>> g = Utils.createEmptyAdjacencyList(3); Utils.addDirectedEdge(g, 0, 1); Utils.addDirectedEdge(g, 1, 2); int[] order = {2, 1, 0}; assertThat(isTopsortOrderin...
fim
williamfiset/algorithms
java
/** * Tests for Kosaraju's algorithm * * <p>bazel test //src/test/java/com/williamfiset/algorithms/graphtheory:KosarajuTest */ package com.williamfiset.algorithms.graphtheory; import static com.google.common.truth.Truth.assertThat; import static org.junit.jupiter.api.Assertions.assertThrowsExactly; import com.goo...
fim
williamfiset/algorithms
java
<|fim_suffix|> LazyPrimsAdjacencyList solver = new LazyPrimsAdjacencyList(g); assertThat(solver.getMstCost()).isEqualTo(6L); assertThat(solver.getMst()).hasLength(3); } @Test public void testClassicGraph9Nodes() { List<List<Edge>> g = createGraph(9); addEdge(g, 0, 1, 4); addEdge(g, 0, 7, 8); ...
fim
williamfiset/algorithms
java
<|fim_suffix|>th; i++) { assertThat(testSteiner(matrix1, 0)).isEqualTo(0.0); } for (int i = 0; i < matrix2.length; i++) { assertThat(testSteiner(matrix2, 0)).isEqualTo(0.0); } } @Test public void testTreeGraph() { assertThat(testSteiner(matrix1, 2, 4)).isEqualTo(6.0); assertThat(t...
fim
williamfiset/algorithms
java
<|fim_prefix|>package com.williamfiset.algorithms.graphtheory; import static com.google.com<|fim_suffix|> addEdge(g, 2, 5); addEdge(g, 5, 3); addEdge(g, 3, 2); addEdge(g, 4, 3); addEdge(g, 4, 5); TarjanSccSolverAdjacencyList solver = new TarjanSccSolverAdjacencyList(g); solver.solve(); ...
fim
williamfiset/algorithms
java
<|fim_suffix|> {1, 0} }; assertThrows(IllegalStateException.class, () -> new TspDynamicProgrammingIterative(dist)); } @Test public void testTsp_small1() { int n = 5; double[][] dist = new double[n][n]; for (double[] row : dist) java.util.Arrays.fill(row, 100); // Assume matrix is symme...
fim
williamfiset/algorithms
java
<|fim_prefix|>package com.williamfiset.algorithms.graphtheory; import static com.google.common.truth.Truth.assertThat; import java.util.*; import org.junit.jupiter.api.*; public class TwoSatSolverAdjacencyListTest { //<|fim_suffix|> = createGraph(n); // Full clause: (p or ~p) TwoSatSolverAdjacencyList.ad...
fim
williamfiset/algorithms
java
<|fim_suffix|>public void testSquareBipartiteGraph() { List<List<Integer>> g = createGraph(4); addUndirectedEdge(g, 0, 1); addUndirectedEdge(g, 1, 2); addUndirectedEdge(g, 2, 3); addUndirectedEdge(g, 3, 0); assertThat(new BipartiteGraphCheckAdjacencyList(g).isBipartite()).isTrue(); } @Test ...
fim
williamfiset/algorithms
java
<|fim_prefix|>package com.williamfiset.algorithms.graphtheory.networkflow; import static com.google.common.truth.Truth.assertThat; import com.williamfiset.algorithms.graphtheory.networkflow.NetworkFlowSolverBase.Edge; import java.util.*; import org.junit.jupiter.api.*; public class MaxFlowTests { List<NetworkFlow...
fim
williamfiset/algorithms
java
package com.williamfiset.algorithms.graphtheory.networkflow; import static com.google.common.truth.Truth.assertThat; import java.util.*; import org.junit.jupiter.api.*; public class MinCostMaxFlowTests { List<NetworkFlowSolverBase> solvers; @BeforeEach public void setUp() { solvers = new ArrayList<>(); ...
fim
williamfiset/algorithms
java
<|fim_prefix|>package com.williamfiset.algorithms.graphtheory.treealgorithms; import static com.google.common.truth.Truth.assertThat; import static org.junit.jupiter.api.Assertions.assertThrows; import java.util.*; import org.junit.jupiter.api.*; public class LowestCommonAncestorEulerTourTest { private LowestComm...
fim
williamfiset/algorithms
java
<|fim_suffix|>3); addUndirectedEdge(graph, 2, 6); addUndirectedEdge(graph, 6, 7); addUndirectedEdge(graph, 6, 8); return graph; } @Test public void testSimpleRooting1() { List<List<Integer>> graph1 = getGraph1(); // Graph 1 rooted at 6 should look like: // 6 // 2 ...
fim
williamfiset/algorithms
java
<|fim_prefix|>// To run this test in isolation from root folder: // // $ bazel test //src/test/java/com/williamfiset/algorithms/graphtheory/treealgorithms:TreeCenterLongestPathImplTest package com.williamfiset.algorithms.graphtheory.treealgorithms; import static com.google.common.truth.Truth.assertThat; import static...
fim
williamfiset/algorithms
java
<|fim_suffix|>n) { List<Integer> nodes = new ArrayList<>(); nodes.add(0); List<List<Integer>> g = createEmptyTree(n); for (int nextNode = 1; nodes.size() != n; nextNode++) { int randomNode = nodes.get((int) (Math.random() * nodes.size())); addUndirectedEdge(g, randomNode, nextNode); n...
fim
williamfiset/algorithms
java
<|fim_prefix|>package com.williamfiset.algorithms.graphtheory.treealgorithms; import static com.google.common.truth.Truth.assertThat; import static com.williamfiset.algorithms.graphtheory.treealgorithms.TreeIsomorphism.addUndirectedEdge; import static com.williamfiset.algorithms.graphtheory.treealgorithms.TreeIsomorph...
fim
williamfiset/algorithms
java
<|fim_prefix|>package com.williamfiset.algorithms.math; import static com.google.common.truth.Truth.assertThat; import static org.junit.jupiter.api.Assertions.assertThrows; import java.math.BigInt<|fim_suffix|>tes C(n, r) mod p using BigInteger as a reference. */ private static long bigIntCnr(int n, int r, int p) {...
fim
williamfiset/algorithms
java
<|fim_prefix|>package com.williamfiset.algorithms.math; import static com.google.common.truth.Truth.assertThat; import static org.junit.jupiter.api.Assertions.assertNull; import org.junit.jupiter.api.*; public class ChineseRemainderTheoremTest { // --- eliminateCoefficient tests --- @Test public void elimina...
fim
williamfiset/algorithms
java
<|fim_suffix|> primes near the upper range. assertThat(CompressedPrimeSieve.isPrime(sieve, 9973)).isTrue(); assertThat(CompressedPrimeSieve.isPrime(sieve, 9967)).isTrue(); // Some known composites near the upper range. assertThat(CompressedPrimeSieve.isPrime(sieve, 9999)).isFalse(); assertThat(Compr...
fim
williamfiset/algorithms
java
<|fim_prefix|>package com.williamfiset.algorithms.math; import static com.google.common.truth.Truth.assertThat; import static org.junit.jupiter.api.Assertions.assertThrows; import org.junit.jupiter.api.*; public class EulerTotientFunctionTest { // Known values: https://oeis.org/A000010 private static final long...
fim
williamfiset/algorithms
java
package com.williamfiset.algorithms.math; import static com.google.common.truth.Truth.assertThat; import static org.junit.jupiter.api.Assertions.assertThrows; import java.math.BigInteger; import java.util.concurrent.ThreadLocalRandom; import org.junit.jupiter.api.*; public class ModPowTest { @Test public void b...
fim
williamfiset/algorithms
java
<|fim_prefix|>package com.williamfiset.algorithms.math; import static com.google.common.truth.Truth.assertThat; import static org.junit.jupiter.api.Assertions.assertThrows; import java.util.*; import org.junit.jupiter.api.*; public class PrimeFactorizationTest { private static void assertFactors(long n, Long... e...
fim
williamfiset/algorithms
java
<|fim_suffix|>); } @Test public void testClearBit() { assertThat(BitManipulations.clearBit(0b0000, 1)).isEqualTo(0); assertThat(BitManipulations.clearBit(0b0100, 2)).isEqualTo(0); assertThat(BitManipulations.clearBit(0b0001, 0)).isEqualTo(0); assertThat(BitManipulations.clearBit(0b1111, 0)).isEqu...
fim
williamfiset/algorithms
java
<|fim_suffix|>5, 20); Set<String> binary = normalize(PowerSet.powerSetBinary(set)); Set<String> recursive = normalize(PowerSet.powerSetRecursive(set)); assertThat(binary).isEqualTo(recursive); } @Test public void correctSize() { for (int n = 0; n <= 5; n++) { List<Integer> set = new ArrayLi...
fim
williamfiset/algorithms
java
<|fim_suffix|>i < ar.length; i++) { if (Math.random() < 0.5) { ar[i] = (int) (Math.random() * +25); } else { ar[i] = (int) (Math.random() * -25); } } } public static void randomizedTest(int n) { double r = Math.max(0.1, Math.random()); int[] ar = new int[n]; fillR...
fim
williamfiset/algorithms
java
package com.williamfiset.algorithms.search; import static com.google.common.truth.Truth.assertThat; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.*; public class InterpolationSearchTest { private static Arguments[] inputs() { return new Arguments[] { Argumen...
fim
williamfiset/algorithms
java
<|fim_prefix|>package com.williamfiset.algorithms.sorting; import static com.google.common.truth.Truth.assertThat; import com.williamfiset.algorithms.utils.TestUtils; import java.util.Arrays; import org.junit.jupiter.api.*; public class BubbleSortTest { private final BubbleSort sorter = new BubbleSort(); @Test...
fim
williamfiset/algorithms
java
<|fim_prefix|>package com.williamfiset.algorithms.sorting; import static com.google.common.truth.Truth.assertThat; import com.williamfiset.algorithms.utils.TestUtils; import java.util.Arrays; import org.junit.jupiter.api.*; public class BucketSortTest { private final BucketSort sorter = new BucketSort(); @Test...
fim
williamfiset/algorithms
java
package com.williamfiset.algorithms.sorting; import static com.google.common.truth.Truth.assertThat; import com.williamfiset.algorithms.utils.TestUtils; import java.util.Arrays; import org.junit.jupiter.api.*; public class CountingSortTest { private final CountingSort sorter = new CountingSort(); @Test publi...
fim
williamfiset/algorithms
java
<|fim_prefix|>package com.willi<|fim_suffix|>; public class HeapsortTest { private final Heapsort sorter = new Heapsort(); @Test public void testEmptyArray() { int[] array = {}; sorter.sort(array); assertThat(array).isEqualTo(new int[] {}); } @Test public void testSingleElement() { int[]...
fim
williamfiset/algorithms
java
<|fim_prefix|>package com.williamfiset.algorithms.sorting; import static com.google.common.truth.Truth.assertThat; import com.williamfiset.algorithms.utils.TestUtils; import java.util.Arrays; import org.juni<|fim_suffix|>= {1, 2, 3, 4, 5}; sorter.sort(array); assertThat(array).isEqualTo(new int[] {1, 2, 3, 4,...
fim
williamfiset/algorithms
java
<|fim_suffix|>blic void testTwoElements() { int[] array = {9, 1}; sorter.sort(array); assertThat(array).isEqualTo(new int[] {1, 9}); } @Test public void testStaticMergesortMethod() { int[] array = {10, 4, 6, 4, 8, -13, 2, 3}; int[] result = MergeSort.mergesort(array); assertThat(result).i...
fim
williamfiset/algorithms
java
<|fim_prefix|>package com.williamfiset.algorithms.sorting; import static com.google.common.truth.Truth.assertThat; import com.williamfiset.algorithms.utils.TestUtils; import java.util.Arrays; import org.junit.jupiter.api.Test; public class QuickSelectTest { @Test public void testQuickSelect() { <|fim_suffix|...
fim
williamfiset/algorithms
java
<|fim_suffix|> {-13, 2, 3, 4, 4, 6, 8, 10}); } @Test public void testAllSameElements() { int[] array = {5, 5, 5, 5, 5}; sorter.sort(array); assertThat(array).isEqualTo(new int[] {5, 5, 5, 5, 5}); } @Test public void testManyDuplicates() { // QuickSort3 is specifically optimized for arrays ...
fim
williamfiset/algorithms
java
<|fim_suffix|>; size++) { int[] values = TestUtils.randomIntegerArray(size, -50, 51); int[] expected = values.clone(); Arrays.sort(expected); sorter.sort(values); assertThat(values).isEqualTo(expected); } } } <|fim_prefix|>package com.williamfiset.algorithms.sorting; import static c...
fim
williamfiset/algorithms
java
<|fim_suffix|>copy = values.clone(); Arrays.sort(values); RadixSort.radixSort(copy); assertThat(values).isEqualTo(copy); } } @Test public void randomRadixSort_largeNumbers() { for (int size = 0; size < 1000; size++) { int[] values = new int[size]; for (int i = 0; i < size;...
fim
williamfiset/algorithms
java
<|fim_suffix|>lic void testSingleElement() { int[] array = {42}; sorter.sort(array); assertThat(array).isEqualTo(new int[] {42}); } @Test public void testAlreadySorted() { int[] array = {1, 2, 3, 4, 5}; sorter.sort(array); assertThat(array).isEqualTo(new int[] {1, 2, 3, 4, 5}); } @Te...
fim
williamfiset/algorithms
java
<|fim_prefix|>package com.williamfiset.algorithms.sorting; import static com.google.common.truth.Truth.assertThat; import com.williamfiset.algorithms.utils.TestUtils; import java.util.Arrays; import java.util.EnumSet; import org.junit.jupiter.api.Test; // Test all sorting algorithms under various constraints. // // ...
fim
williamfiset/algorithms
java
<|fim_prefix|>package com.williamfiset.algorithms.sorting; import static com.google.common.truth.Truth.assertThat; import com.williamfiset.algorithms.utils.TestUtils; import java.util.Arrays; import org.junit.jupiter.api.*; public class TimSortTest { private final TimSort sorter = new TimSort(); @Test public...
fim
williamfiset/algorithms
java
package com.williamfiset.algorithms.strings; import static com.google.common.truth.Truth.assertThat; import static java.util.Objects.isNull; import java.util.ArrayList; import java.util.List; import java.util.Random; import org.junit.jupiter.api.*; public class BoyerMooreStringSearchTest { private BoyerMooreStrin...
fim
williamfiset/algorithms
java
<|fim_prefix|>/** * Run like: $ bazel test //src/test/java/com/williamfiset/algorithms/strings:LongestCommonSubstringTest */ package com.williamfiset.algorithms.strings; import static com.google.common.truth.Truth.assertThat; import static com.williamfiset.algorithms.strings.LongestCommonSubstring.LcsSolver; import...
fim
williamfiset/algorithms
java
<|fim_prefix|>package com.williamfiset.algorithms.strings; import static com.google.common.truth.Truth.assertThat; import org.junit.jupiter.api.*; public class ZAlgorithmTest { private ZAlgorithm underTest; @BeforeEach public void setup() { underTest = new ZAlgorithm(); } @Test public void shouldRe...
fim
williamfiset/algorithms
java
<|fim_prefix|>/* * Copyright (c) 2022 Winsider Seminars & Solutions, Inc. All rights reserved. * * This file is part of System Informer. * * Authors: * * jxy-s 2022-2026 * */ #include <kph.h> #include <trace.h> typedef struct _KPH_LOOKASIDE_INIT { SIZE_T Size; ULONG Tag; } KPH_LOOKASIDE_INIT,...
fim
winsiderss/systeminformer
c
<|fim_suffix|>ired. * \param[in] AccessMode The mode in which to perform access checks. * * \return Successful or errant status. */ _IRQL_requires_max_(PASSIVE_LEVEL) _Must_inspect_result_ NTSTATUS KphAlpcQueryInformation( _In_ HANDLE ProcessHandle, _In_ HANDLE PortHandle, _In_ KPH_ALPC_INFORMATION_CLAS...
fim
winsiderss/systeminformer
c
<|fim_prefix|>/* * Copyright (c) 2022 Winsider Seminars & Solutions, Inc. All rights reserved. * * This file is part of System Informer. * * Authors: * * jxy-s 2023-2026 * */ #include <kph.h> #include <trace.h> typedef struct _KPH_STACK_BACK_TRACE_OBJECT { KSI_KAPC Apc; KEVENT CompletedEvent;...
fim
winsiderss/systeminformer
c
<|fim_prefix|>/* * Copyright (c) 2022 Winsider Seminars & Solutions, Inc. All rights reserved. * * This file is part of System Informer. * * Authors: * * jxy-s 2022-2026 * */ #include <kph.h> #include <trace.h> #define KPH_CID_TABLE_LEVEL_MASK ((ULONG_PTR)3) #define KPH_CID_TABLE_L0 ((ULONG_PTR)0) #d...
fim
winsiderss/systeminformer
c
<|fim_prefix|>/* * Copyright (c) 2022 Winsider Seminars & Solutions, Inc. All rights reserved. * * This file is part of System Informer. * * Authors: * * jxy-s 2022-2026 * */ #include <kph.h> #include <informer.h> #include <trace.h> typedef struct _KPH_CID_APC { KSI_KAPC Apc; KEVENT Completed...
fim
winsiderss/systeminformer
c
<|fim_suffix|>lientCount = KphpCommsSendMessageToRingBuffers(targetClients, Message); if (!targetClientCount) { goto Exit; } } item = KphpAllocateMessageQueueItem(); if (!item) { KphTracePrint(TRAC...
fim
winsiderss/systeminformer
c
<|fim_suffix|> UserMode); return STATUS_SUCCESS; } _Function_class_(KPHM_HANDLER) _IRQL_requires_max_(PASSIVE_LEVEL) _Must_inspect_result_ NTSTATUS KSIAPI KphpCommsTerminateProcess( _In_ PKPH_CLIENT Client, _Inout_ PKPH_MESSAGE Message ) { PKPHM_TERMINATE_PROCESS msg; ...
fim
winsiderss/systeminformer
c
<|fim_suffix|>e base device object associated with a device object. * * \details The base device object is the lowest-level device object in the file * system or device driver stack. * * \param[in] DeviceHandle Handle to a device object. * \param[in] DesiredAccess Desired access to the base device object. * \par...
fim
winsiderss/systeminformer
c
<|fim_suffix|> &returnLength, AccessMode); break; } case KphDriverServiceKeyNameInformation: { PCUNICODE_STRING serviceKeyName; // // The name of the driver's service key - e.g. \REGISTRY\... ...
fim
winsiderss/systeminformer
c
<|fim_prefix|>/* * Copyright (c) 2022 Winsider Seminars & Solutions, Inc. All rights reserved. * * This file is part of System Informer. * * Authors: * * wj32 2010-2016 * jxy-s 2022-2026 * */ #include <kph.h> #include <kphdyndata.h> #include <trace.h> typedef struct _KPH_DYN_INIT { PKPH_D...
fim
winsiderss/systeminformer
c
<|fim_prefix|>/* * Copyright (c) 2022 Winsider Seminars & Solutions, Inc. <|fim_suffix|>PENED_AS_COPY_DESTINATION KphDynIoCheckFileObjectOpenedAsCopyDestination = NULL; PFLT_GET_COPY_INFORMATION_FROM_CALLBACK_DATA KphDynFltGetCopyInformationFromCallbackData = NULL; PPS_GET_SILO_IDENTIFIER KphDynPsGetSiloIdentifier = N...
fim
winsiderss/systeminformer
c
<|fim_prefix|>/* * Copyright (c) 2022 Winsider Seminars & Solutions, Inc. All rights reserved. * * This file is part of System Informer. * * Authors: * * jxy-s 2022-2026 * */ #include <kph.h> #include <trace.h> KPH_PAGED_FILE(); /** * \brief Checks if a file handle is safe to issue a query through....
fim
winsiderss/systeminformer
c
<|fim_prefix|>/* * Copyright (c) 2022 Winsider Seminars & Solutions, Inc. All rights reserved. * * This file is part of System Informer. * * Authors: * * jxy-s 2022-2026 * */ #include <kph.h> #include <informer.h> #include <trace.h> #define KPH_HASHING_BUFFER_SIZE (16 * 1024) #define KPH_HASH_EACACH...
fim
winsiderss/systeminformer
c
<|fim_prefix|>/* * Copyright (c) 2022 Winsider Seminars & Solutions, Inc. All rights reserved. * * This file is part of System Informer. * * Authors: * * jxy-s 2024-2026 * */ #include <kph.h> #include <trace.h> KPH_PAGED_FILE(); /** * \brief Checks an image for coherency against the data backing th...
fim
winsiderss/systeminformer
c
/* * Copyright (c) 2022 Winsider Seminars & Solutions, Inc. All rights reserved. * * This file is part of System Informer. * * Authors: * * jxy-s 2022-2026 * */ #pragma once #include <kphmsg.h> typedef struct _KPH_CLIENT_INFORMER_STATE { KPH_MESSAGE_TIMEOUTS MessageTimeouts; KPH_RATE_LIMIT Asy...
fim
winsiderss/systeminformer
c
<|fim_suffix|>EVEL) VOID KphObjectInformerStop( VOID ); // registry informer _IRQL_requires_max_(PASSIVE_LEVEL) _Must_inspect_result_ NTSTATUS KphRegistryInformerStart( VOID ); _IRQL_requires_max_(PASSIVE_LEVEL) VOID KphRegistryInformerStop( VOID ); // debug informer _IRQL_requires_max_(PAS...
fim
winsiderss/systeminformer
c
<|fim_prefix|>/* * Copyright (c) 2022 Winsider Seminars & Solutions, Inc. All rights reserved. * * This file is part of System Informer. * * Authors: * * jxy-s 2023-2026 * */ #pragma once // informer_fileop.c _Function_class_(PFLT_POST_OPERATION_CALLBACK) _IRQL_requires_max_(DISPATCH_LEVEL) FLT_POSTOP...
fim
winsiderss/systeminformer
c
<|fim_suffix|>deprecated("ExAllocateFromPagedLookasideList") #pragma deprecated("ExAllocatePool") #pragma deprecated("ExAllocatePool2") #pragma deprecated("ExAllocatePool3") #pragma deprecated("ExAllocatePoolPriorityUninitialized") #pragma deprecated("ExAllocatePoolPriorityZero") #pragma deprecated("ExAllocatePoolQuota...
fim
winsiderss/systeminformer
c
<|fim_prefix|>/* * This file is part of System Informer. * * Authors: * * jxy-s 2022-2026 * */ #pragma once typedef struct _CLIENT_ID32 { ULONG UniqueProcess; ULONG UniqueThread; } CLIENT_ID32, *PCLIENT_ID32; typedef struct _CLIENT_ID64 { ULONGLONG UniqueProcess; ULONGLONG UniqueThread; ...
fim
winsiderss/systeminformer
c
<|fim_suffix|>' #define KPH_TAG_CID_APC '4cpK' #define KPH_TAG_PROCESS_IMAGE_FILE_NAME '5cpK' // protection #define KPH_TAG_IMAGE_LOAD_APC '0ppK' // alpc #define KPH_TAG_ALPC_NAME_QUERY '0apK' #define KPH_TAG_ALPC_QUERY '1apK' //...
fim
winsiderss/systeminformer
c
<|fim_suffix|>= level) // // begin_wpp config // FUNC KphTracePrint(LEVEL,EVENT,MSG, ...); // end_wpp // #ifdef KSI_NO_WPP #define KphTracePrint(LEVEL,EVENT,MSG,...) ((void)(MSG, ## __VA_ARGS__)) #define WPP_INIT_TRACING(...) ((void)0) #define WPP_CLEANUP(...) ((void)0) #endif #define ...
fim
winsiderss/systeminformer
c
<|fim_prefix|>/* * Copyright (c) 2022 Winsider Seminars & Solutions, Inc. All rights reserved. * * This file is part of System Informer. * * Authors: * * jxy-s 2023-2026 * */ #include <kph.h> #include <comms.h> #include <informer.h> #include <trace.h> typedef struct _KPH_INFORMER_STATE { KPH_INFO...
fim
winsiderss/systeminformer
c
<|fim_prefix|>/* * Copyright (c) 2022 Winsider Seminars & Solutions, Inc. All rights reserved. * * This file is part of System Informer. * * Authors: * * jxy-s 2022-2026 * */ #include <kph.h> #include <informer.h> #include <comms.h> #include <kphmsgdyn.h> #include <trace.h> typedef struct _KPH_DBG_PR...
fim
winsiderss/systeminformer
c
<|fim_prefix|>/* * Copyright (c) 2022 Winsider Seminars & Solutions, Inc. All rights reserved. * * This file is part of System Informer. * * Authors: * * jxy-s 2022-2026 * */ #include <kph.h> #include <comms.h> #include <informer_filep.h> #include <trace.h> KPH_PROTECTED_DATA_SECTION_RO_PUSH(); stati...
fim
winsiderss/systeminformer
c
<|fim_suffix|>te = TRUE; KphCreateObjectType(&KphpCachedFileNameTypeName, &typeInfo, &KphpCachedFileNameType); KphpFileNameCacheInitialized = TRUE; } <|fim_prefix|>/* * Copyright (c) 2022 Winsider Seminars & Solutions, Inc. All rights reserved. * * This file...
fim
winsiderss/systeminformer
c
<|fim_suffix|> * \param[in] FltObjects The related objects for the operation. */ _IRQL_requires_max_(APC_LEVEL) VOID KphpFltRequestHandler( _Inout_ PFLT_CALLBACK_DATA Data, _In_ PCFLT_RELATED_OBJECTS FltObjects ) { PKPH_THREAD_CONTEXT thread; KPH_NPAGED_CODE_APC_MAX_FOR_PAGING_IO(); // /...
fim
winsiderss/systeminformer
c
<|fim_suffix|>ERBOSE, INFORMER, "KphMsgDynAddUnicodeString failed: %!STATUS!", status); } status = KphMsgDynAddUnicodeString(msg, KphMsgFieldCertificateIssuer, &ImageI...
fim
winsiderss/systeminformer
c
<|fim_suffix|> INFORMER, "ObQueryNameString failed: %!STATUS!", status); goto Exit; } status = KphMsgDynAddUnicodeString(Message, KphMsgFieldObjectName, &info->Name...
fim
winsiderss/systeminformer
c
<|fim_prefix|>/* * Copyright (c) 2022 Winsider Seminars & Solutions, Inc. All rights reserved. * * This file is part of System Informer. * * Authors: * * jxy-s 2022-2026 * */ #include <kph.h> #include <informer.h> #include <comms.h> #include <kphmsgdyn.h> #include <trace.h> typedef struct _KPH_PROCES...
fim
winsiderss/systeminformer
c
<|fim_prefix|>/* * Copyright (c) 2022 Winsider Seminars & Solutions, Inc. All rights reserved. * * This file is part of System Informer. * * Authors: * * jxy-s 2023-2026 * */ #include <kph.h> #include <informer.h> #include <comms.h> #include <kphmsgdyn.h> #include <trace.h> typedef union _KPH_REG_OPT...
fim
winsiderss/systeminformer
c
<|fim_suffix|>mation(Silo, &msg->Kernel.SiloTerminate.Silo); if (Silo) { KphpCopySiloName(msg, Silo, KphMsgFieldObjectName); } if (KphDynPsGetEffectiveServerSilo) { PESILO serverSilo; serverSilo = KphDynPsGetEffectiveServerSilo(Silo); KphpCopySiloInformation(serve...
fim
winsiderss/systeminformer
c
<|fim_suffix|>fyExit); KphDereferenceObject(thread); } thread = KphpPerformThreadTracking(ProcessId, ThreadId, FALSE, threadObject); } if (thread) {...
fim
winsiderss/systeminformer
c
<|fim_prefix|>/* * Copyright (c) 2022 Winsider Seminars & Solutions, Inc. All rights reserved. * * This file is part of System Informer. * * Authors: * * jxy-s 2022-2026 * */ #include <kph.h> #include <trace.h> typedef struct _KPH_KNOWN_DLL_EXPORT { PCHAR Name; PVOID* Storage; } KPH_KNOWN_DLL...
fim
winsiderss/systeminformer
c
<|fim_suffix|>aterNumberOfObjects, total); *Object = object; return STATUS_SUCCESS; } /** * \brief References an object. * * \param[in] Object The object to reference. */ _IRQL_requires_max_(HIGH_LEVEL) VOID KphReferenceObject( _In_ PVOID Object ) { PKPH_O...
fim
winsiderss/systeminformer
c
<|fim_suffix|>ength = ThreadName->Length; context->ThreadName.Buffer = Add2Ptr(context, sizeof(KPH_THREAD_START_CONTEXT)); RtlCopyUnicodeString(&context->ThreadName, ThreadName); } if (FlagOn(Flags, KPH_CREATE_SYSTEM_THREAD_IN_KSI_PROCESS)) { processHandle = KphpKsiSystemProcessHand...
fim
winsiderss/systeminformer
c
/* * Copyright (c) 2022 Winsider Seminars & Solutions, Inc. All rights reserved. * * This file is part of System Informer. * * Authors: * * jxy-s 2022-2026 * */ #include <kph.h> #include <process.h> #include <sistatus.h> // // This library is intended to be an extension of core OS functionality which ...
fim
winsiderss/systeminformer
c
<|fim_prefix|>/* * Copyright (c) 2022 Winsider Seminars & Solutions, Inc. All rights reserved. * * This file is part of System Informer. * * Authors: * * jxy-s 2024-2026 * */ #include <kph.h> #include <trace.h> KPH_PROTECTED_DATA_SECTION_RO_PUSH(); static const UNICODE_STRING KphpLsaPortName = RTL_CO...
fim
winsiderss/systeminformer
c
<|fim_prefix|>/* * Copyright (c) 2022 Winsider Seminars & Solutions, Inc. All rights reserved. * * This file is part of System Informer. * * Authors: * * wj32 2010-2016 * jxy-s 2021-2026 * */ #include <kph.h> #include <informer.h> #include <trace.h> KPH_PROTECTED_DATA_SECTION_RO_PUSH(); stati...
fim
winsiderss/systeminformer
c
<|fim_prefix|>/* * Copyright (c) 2022 Winsider Seminars & Solutions, Inc. All rights reserved. * * This file is part of System Informer. * * Authors: * * wj32 2010-2016 * jxy-s 2021-2026 * */ #include <kph.h> #include <trace.h> typedef struct _KPH_ENUMERATE_PROCESS_HANDLES_CONTEXT { PKPH_...
fim
winsiderss/systeminformer
c
<|fim_suffix|>&value); if (!NT_SUCCESS(status)) { value = (PUNICODE_STRING)parameter->Default; } } else { value = (PUNICODE_STRING)parameter->Default; }...
fim
winsiderss/systeminformer
c
<|fim_prefix|>/* * Copyright (c) 2022 Winsider Seminars & Solutions, Inc. All rights reserved. * * This file is part of System Informer. * * Authors: * * wj32 2010-2016 * jxy-s 2020-2026 * */ #include <kph.h> #include <trace.h> KPH_PAGED_FILE(); /** * \brief Opens a process. * * \param[ou...
fim
winsiderss/systeminformer
c
/* * Copyright (c) 2022 Winsider Seminars & Solutions, Inc. All rights reserved. * * This file is part of System Informer. * * Authors: * * wj32 2010-2016 * jxy-s 2020-2026 * */ #include <kph.h> #include <trace.h> typedef struct _KPH_ENUM_FOR_PROTECTION { PKPH_DYN Dyn; PKPH_PROCESS_CO...
fim
winsiderss/systeminformer
c
<|fim_suffix|>wBucket.CurrentTokens))) { newBucket.CurrentTokens = RateLimit->Policy.MaxBucketSize; } else { newBucket.CurrentTokens = (newBucket.CurrentTokens + (ULONG)tokensToAdd); } newBucket.LastRefillTime = currentTime; ConsumeToken: ...
fim
winsiderss/systeminformer
c
<|fim_suffix|> = NULL; *Ring = ring; ring = NULL; status = STATUS_SUCCESS; Exit: if (userConsumerBase) { MmUnmapViewOfSection(PsGetCurrentProcess(), userConsumerBase); } if (userProducerBase) { MmUnmapViewOfSection(PsGetCurrentProcess(), userProducerBase); } ...
fim
winsiderss/systeminformer
c
<|fim_prefix|>/* * Copyright (c) 2022 Winsider Seminars & Solutions, Inc. All rights reserved. * * This file is part of System Informer. * * Authors: * * jxy-s 2023-2026 * */ #include <kph.h> #include <trace.h> typedef struct _KPH_SESSION_TOKEN_INIT { LARGE_INTEGER Expiry; ULONG Privileges; ...
fim
winsiderss/systeminformer
c