Compare commits

...

1455 Commits

Author SHA1 Message Date
8d4a90c0e1
Merge pull request #366 from gnh1201/dev
Some checks failed
CodeQL / Analyze (javascript) (push) Has been cancelled
Deploy Jekyll with GitHub Pages dependencies preinstalled / build (push) Has been cancelled
Deploy Jekyll with GitHub Pages dependencies preinstalled / deploy (push) Has been cancelled
Fix some bugs (Catswords.Phantomizer)
2025-12-11 17:43:28 +09:00
5fa99240bd Update README.md (Catswords.Phantomizer)
Update README.md (Catswords.Phantomizer)
2025-12-11 17:34:40 +09:00
495a3b8b93 Update Catswords.Phantomizer.dll.gz
Update the Catswords.Phantomizer embedded assembly
2025-12-11 17:31:59 +09:00
aeeeb253fb Update version to 1.0.0.1 (Catswords.Phantomizer)
Update version to 1.0.0.1 (Catswords.Phantomizer)
2025-12-11 17:18:09 +09:00
b0dac00af7 Update README.md (Catswords.Phantomizer)
Update README.md (Catswords.Phantomizer)
2025-12-11 17:16:02 +09:00
48f1f66fa2 Fix some bugs (Catswords.Phantomizer)
Fix some bugs (Catswords.Phantomizer)
2025-12-11 17:13:31 +09:00
2cb422d075
Merge pull request #365 from gnh1201/dev
Update the integrity check (Catswords.Phantomizer)
2025-12-11 15:16:21 +09:00
2b3a80bf98 Update README.md (Catswords.Phantomizer)
Update README.md (Catswords.Phantomizer)
2025-12-10 15:32:39 +09:00
14cb0670f2 Update README.md (Catswords.Phantomizer)
Update README.md (Catswords.Phantomizer)
2025-12-10 15:29:01 +09:00
f57c99df9f Update README.md (Catswords.Phantomizer)
Update README.md (Catswords.Phantomizer)
2025-12-10 15:23:27 +09:00
f86305b33f Update README.md (Catswords.Phantomizer)
Update README.md (Catswords.Phantomizer)
2025-12-10 15:05:45 +09:00
145547b6d8 Update README.md (Catswords.Phantomizer)
Update README.md (Catswords.Phantomizer)
2025-12-10 15:03:50 +09:00
97f4020af2 Update README.md (Catswords.Phantomizer)
Update README.md (Catswords.Phantomizer)
2025-12-10 14:55:51 +09:00
0e15aa2b1f Add hash-based assembly integrity check
Add hash-based assembly integrity check
2025-12-10 14:36:59 +09:00
668d2000d3
Create cats.txt
Some checks failed
CodeQL / Analyze (javascript) (push) Has been cancelled
Deploy Jekyll with GitHub Pages dependencies preinstalled / build (push) Has been cancelled
Deploy Jekyll with GitHub Pages dependencies preinstalled / deploy (push) Has been cancelled
Inspired by the i83 cats.txt draft format, integrated within the IETF cats.txt structure.
2025-12-10 10:41:12 +09:00
40dd2c1b8a
Create AGENTS.md
Some checks are pending
CodeQL / Analyze (javascript) (push) Waiting to run
Deploy Jekyll with GitHub Pages dependencies preinstalled / build (push) Waiting to run
Deploy Jekyll with GitHub Pages dependencies preinstalled / deploy (push) Blocked by required conditions
2025-12-09 17:42:46 +09:00
b75166aa05
Merge pull request #364 from gnh1201/dev
Some checks failed
CodeQL / Analyze (javascript) (push) Has been cancelled
Deploy Jekyll with GitHub Pages dependencies preinstalled / build (push) Has been cancelled
Deploy Jekyll with GitHub Pages dependencies preinstalled / deploy (push) Has been cancelled
Update README.md (Catswords.Phantomizer)
2025-12-08 13:30:02 +09:00
dfb821d1d7
Update README.md 2025-12-08 11:41:40 +09:00
37ed467384
Update README.md 2025-12-08 11:40:36 +09:00
a023ee9d3e
Merge pull request #363 from gnh1201/dev
Update README.md (Catswords.Phantomizer)
2025-12-08 11:39:04 +09:00
0e23c4c1db
Update README.md 2025-12-08 11:34:25 +09:00
94f397eb46
Update README.md 2025-12-08 11:31:29 +09:00
386c7ca7a1
Merge pull request #362 from gnh1201/dev
Edit README.md (Catswords.Phantomizer)
2025-12-08 11:09:55 +09:00
ec4b3b2d7d
Add the Catswords.Phantomizer Structure Overview
Add the Catswords.Phantomizer Structure Overview
2025-12-08 10:49:18 +09:00
e3562856b0
Update README.md 2025-12-08 10:39:53 +09:00
cfc7dbf144
Update README.md 2025-12-08 10:39:04 +09:00
f24375797c
Update README.md 2025-12-08 10:37:37 +09:00
e9cc0cde13
Update README.md 2025-12-08 10:22:46 +09:00
8623cb315d
Update README.md 2025-12-08 10:22:11 +09:00
2040a02628
Merge pull request #361 from gnh1201/dev
Some checks are pending
CodeQL / Analyze (javascript) (push) Waiting to run
Deploy Jekyll with GitHub Pages dependencies preinstalled / build (push) Waiting to run
Deploy Jekyll with GitHub Pages dependencies preinstalled / deploy (push) Blocked by required conditions
Introduce the Catswords.Phantomizer to load DLL files via network
2025-12-08 02:19:02 +09:00
Namhyeon, Go
037e692432 Update README.md 2025-12-08 02:13:16 +09:00
Namhyeon, Go
ac6df725f4 Update README.md 2025-12-08 02:06:17 +09:00
Namhyeon, Go
ec79f1ab06 Update README.md 2025-12-08 01:55:10 +09:00
Namhyeon, Go
6839b8edd1 Fix namespace bug when use the assembly loader
Fix namespace bug when use the assembly loader
2025-12-08 01:53:49 +09:00
Namhyeon, Go
28776d7cad Update Catswords.Phantomizer.dll.gz 2025-12-08 01:34:49 +09:00
Namhyeon, Go
c1448ead32 Update README.md 2025-12-08 01:33:33 +09:00
Namhyeon, Go
aafab2032c Update README.md 2025-12-08 01:31:37 +09:00
Namhyeon, Go
c68b73ce7b Update Catswords.Phantomizer.csproj 2025-12-08 01:20:37 +09:00
Namhyeon, Go
3b588c3446 Update .appveyor.yml 2025-12-08 01:15:25 +09:00
Namhyeon, Go
c357d6f944 Add description: Catswords.Phantomizer
Add description: Catswords.Phantomizer
2025-12-08 01:13:08 +09:00
Namhyeon, Go
1366931273 Update README.md 2025-12-08 01:00:23 +09:00
Namhyeon, Go
f30e43c2e3 Introduce new package Catswords.Phantomizer
Introduce new package `Catswords.Phantomizer`

**Catswords.Phantomizer** is an HTTP-based dynamic-link library (DLL) loader designed for .NET applications.
It allows your application to fetch and load assemblies directly from your CDN (Azure Blob, S3, Cloudflare R2, etc.) at runtime, with optional GZip compression support.
2025-12-08 00:49:10 +09:00
f23705240d
Merge pull request #360 from gnh1201/dev
Some checks are pending
CodeQL / Analyze (javascript) (push) Waiting to run
Deploy Jekyll with GitHub Pages dependencies preinstalled / build (push) Waiting to run
Deploy Jekyll with GitHub Pages dependencies preinstalled / deploy (push) Blocked by required conditions
Separate HttpClient instances for raw and compressed HTTP transfer modes
2025-12-07 02:49:41 +09:00
Namhyeon, Go
e8dbf69491 Clearify an exceptions
Clearify an exceptions
2025-12-07 02:42:26 +09:00
Namhyeon, Go
b3416f9a5f Dual HttpClient setup matches intent; make Legacy behavior explicitly “no decompression”
Dual HttpClient setup matches intent; make Legacy behavior explicitly “no decompression”
2025-12-07 02:26:45 +09:00
Namhyeon, Go
e90808e517 Null-check logger before use
Null-check logger before use
2025-12-07 02:22:44 +09:00
Namhyeon, Go
5747713f99 ntroduce separate HttpClient instances for raw and compressed HTTP transfer modes
Added two HttpClient instances to distinguish between legacy (no
Accept-Encoding) and modern compressed HTTP transfer behaviors.

- LegacyHttp:
  Sends no Accept-Encoding header.
  Used when requesting .dll.gz files, ensuring that the server delivers
  the file exactly as-is without applying HTTP-level compression.

- Http:
  Enables AutomaticDecompression and advertises Accept-Encoding
  (gzip, deflate).
  When the server supports HTTP content compression, even a regular .dll
  file can be transmitted in compressed form and transparently
  decompressed by the client.

This separation prevents ambiguities between:
  - File-level compression (.dll.gz)
  - Transport-level compression (Content-Encoding: gzip/deflate)

and ensures predictable behavior when downloading assemblies depending on
server capabilities.
2025-12-07 00:23:51 +09:00
e5dd13fd1b
Merge pull request #359 from gnh1201/dev
Some checks are pending
CodeQL / Analyze (javascript) (push) Waiting to run
Deploy Jekyll with GitHub Pages dependencies preinstalled / build (push) Waiting to run
Deploy Jekyll with GitHub Pages dependencies preinstalled / deploy (push) Blocked by required conditions
Add support *.dll.gz file in Assembly Loader
2025-12-06 00:46:24 +09:00
Namhyeon, Go
5b86a88111 Use a temporary file for download, An exception clearify
To prevent partial or corrupt files on download failure, write the decompressed
stream to a temporary file first, and then atomically move it to the final
destination upon success.

In TryDownloadGzipToFile, modify the catch block to log the exception details
before returning false, instead of silently swallowing the error.
2025-12-06 00:23:58 +09:00
Namhyeon, Go
4e3c2bc52c Add support *.dll.gz file in Assembly Loader
Add support for *.dll.gz files in Assembly Loader to make downloads faster.
2025-12-06 00:01:50 +09:00
79d83f4346
Merge pull request #358 from gnh1201/dev
Some checks failed
CodeQL / Analyze (javascript) (push) Has been cancelled
Deploy Jekyll with GitHub Pages dependencies preinstalled / build (push) Has been cancelled
Deploy Jekyll with GitHub Pages dependencies preinstalled / deploy (push) Has been cancelled
Added the assembly loader with Azure Blob Storage
2025-12-04 18:23:01 +09:00
7abf705c6e Improve the loader policy
Improve the loader policy
2025-12-04 18:19:30 +09:00
cb41c92eab Improve the loader policy
Improve the loader policy
2025-12-04 18:06:47 +09:00
d2be6b116d Improve the loader policy
Improve the loader policy
2025-12-04 16:21:47 +09:00
eae040530e Code signing is required
Code signing is required
2025-12-04 16:12:47 +09:00
6d3fb3db0e Update AssemblyLoader.cs
comment an unused variables
2025-12-04 16:08:25 +09:00
07e47338cb Added the assembly loader with Azure Blob Storage
Added the assembly loader with Azure Blob Storage
2025-12-04 14:54:21 +09:00
5c41a4bf72
Merge pull request #357 from gnh1201/dev
Some checks are pending
CodeQL / Analyze (javascript) (push) Waiting to run
Deploy Jekyll with GitHub Pages dependencies preinstalled / build (push) Waiting to run
Deploy Jekyll with GitHub Pages dependencies preinstalled / deploy (push) Blocked by required conditions
Add a telemetry to WelsonJS Launcher
2025-12-03 17:05:28 +09:00
e84a69d929 Add null-check for Assembly Version property.
The code properly checks if _telemetryClient is null before tracking the event and uses the assembly version dynamically. However, the Version property of AssemblyName can be null, which would cause a NullReferenceException when calling .ToString().
2025-12-03 16:59:41 +09:00
1d4b7af5b3 Fix the logger for telemetry
Fix the logger for telemetry
2025-12-03 16:54:19 +09:00
3188317bf6 Fix the TelemetryClient
Fix the TelemetryClient
2025-12-03 16:45:31 +09:00
2db2e7b91a Create TelemetryIdentity.cs and more fixes
Create TelemetryIdentity.cs and more fixes
2025-12-03 16:34:41 +09:00
78bcae182e Update telemetryEnabled configuration key
Update telemetryEnabled configuration key
2025-12-03 14:57:59 +09:00
c4e6acc8cd Add a telemetry to WelsonJS Launcher
Add a telemetry to WelsonJS Launcher, To improve debugging experience.
2025-12-03 14:48:30 +09:00
734acb380d
Merge pull request #356 from gnh1201/dev
Some checks are pending
CodeQL / Analyze (javascript) (push) Waiting to run
Deploy Jekyll with GitHub Pages dependencies preinstalled / build (push) Waiting to run
Deploy Jekyll with GitHub Pages dependencies preinstalled / deploy (push) Blocked by required conditions
Add an architecture, and fixed a comment on the telemetry section.
2025-12-02 15:28:03 +09:00
Namhyeon, Go
bf4b2214bc Update postInstall.ps1
Remove the architecture numbers comment (duplicated)
2025-12-02 15:21:32 +09:00
Namhyeon, Go
c240f8dfa8 Update postInstall.ps1
Improve a distinct ID fallback
2025-12-02 15:16:29 +09:00
Namhyeon, Go
77ef5b2270 Merge branch 'dev' of https://github.com/gnh1201/welsonjs into dev 2025-12-02 15:04:00 +09:00
Namhyeon, Go
778cc0641b Update postInstall.ps1
Add an architecture, and fixed a comment on the telemetry section.
2025-12-02 15:03:54 +09:00
4445e86ecb
Merge pull request #355 from gnh1201/dev
Some checks are pending
CodeQL / Analyze (javascript) (push) Waiting to run
Deploy Jekyll with GitHub Pages dependencies preinstalled / build (push) Waiting to run
Deploy Jekyll with GitHub Pages dependencies preinstalled / deploy (push) Blocked by required conditions
Update DownloadUrls.psd1
2025-12-02 10:35:44 +09:00
996cc898ff Update DownloadUrls.psd1
Fix parse error
2025-12-02 10:32:38 +09:00
313e2dd275 Update DownloadUrls.psd1
added more download links
2025-12-02 10:29:17 +09:00
db5887535f
Merge pull request #354 from gnh1201/dev
added more download URLs
2025-12-02 10:11:41 +09:00
6b6ac32111 Update DownloadUrls.psd1
Fix a download links from SourceForge
2025-12-02 10:02:54 +09:00
a7db8a59bd Update DownloadUrls.psd1
added more downoad URLs
2025-12-02 09:52:06 +09:00
19f6bd1552
Merge pull request #353 from gnh1201/dev
Some checks are pending
CodeQL / Analyze (javascript) (push) Waiting to run
Deploy Jekyll with GitHub Pages dependencies preinstalled / build (push) Waiting to run
Deploy Jekyll with GitHub Pages dependencies preinstalled / deploy (push) Blocked by required conditions
Improve the post-install script
2025-12-01 17:37:16 +09:00
Namhyeon, Go
046bb146a9 Fix the architecture number
Fix the architecture number
2025-12-01 17:25:40 +09:00
Namhyeon, Go
e3ec367390 Add logo to postInstall.ps1
Add logo to postInstall.ps1
2025-12-01 17:20:38 +09:00
Namhyeon, Go
c37d42418d Fix mistypos in the post-install script
Fix mistypos in the post-install script, Fix decompression process when the file contains single root
2025-12-01 17:14:28 +09:00
Namhyeon, Go
3058d6c190 Delete binaries_meta.json
Use the `DownloadUrls.psd1` file instead of binaries_meta.json
2025-12-01 16:46:55 +09:00
Namhyeon, Go
95235d4e5f Fix the file path in adb.js
Fix the file path in adb.js
2025-12-01 16:44:03 +09:00
Namhyeon, Go
fc7a13ceba Update adb binary path and contributor info
Changed the default adb binary path to use the app data directory for improved portability. Updated copyright and contributor information. Bumped VERSIONINFO to 0.2.3.
2025-12-01 16:35:54 +09:00
Namhyeon, Go
3e82eeeb4b Add extraction steps for WinDivert and Android Platform Tools
Introduces extraction and installation logic for WinDivert and Android Platform Tools components in postInstall.ps1. Also updates log messages for consistency and clarity.
2025-12-01 16:33:05 +09:00
Namhyeon, Go
0be5bd031d Update installer process handling and cleanup arguments
Removed unnecessary installer arguments and ensured installers run with process waiting for completion in postInstall.ps1. Cleaned up setup.iss to remove redundant 'Components' field for PowerShell execution. Minor formatting fix in DownloadUrls.psd1.
2025-12-01 16:16:43 +09:00
Namhyeon, Go
6b5a5ea08e Rename android_tools component to android_platform_tools
Updated the component name from 'android_tools' to 'android_platform_tools' in setup.iss for consistency and clarity.
2025-12-01 15:47:06 +09:00
Namhyeon, Go
137537d5ca Rename android_tools to android_platform_tools
Updated the component name from 'android_tools' to 'android_platform_tools' in DownloadUrls.psd1 and postInstall.ps1 for consistency and clarity. Adjusted variable names and references accordingly.
2025-12-01 15:46:31 +09:00
Namhyeon, Go
dec8817a32 Add WinDivert and Android Tools components
Introduces WinDivert and Android Platform Tools as selectable components in the installer. Updates DownloadUrls.psd1 with their download URLs, adds their handling in postInstall.ps1, and registers them in setup.iss for installation.
2025-12-01 15:44:36 +09:00
Namhyeon, Go
b95de25502 Update telemetry event properties in postInstall.ps1
Replaces the $process_person_profile property with a product property set to 'welsonjs' in the telemetry event payload for PostHog. This clarifies the product being tracked during installation.
2025-12-01 15:12:08 +09:00
Namhyeon, Go
1c7d9e3b32 Remove tessdata submodules and update install scripts
Deleted tessdata, tessdata_best, and tessdata_fast submodules. Updated DownloadUrls.psd1 to fix Python x86 URL and set gtk3runtime arm64 to null. Improved architecture detection in postInstall.ps1 and cleaned up component selection logic. Modified setup.iss to remove exclusions for tessdata assets and cleaned up run/uninstall sections.
2025-12-01 15:02:40 +09:00
Namhyeon, Go
fc4a238569 Fix component names and update installer script
Corrected syntax errors in component definitions and registry entries, updated post-install PowerShell command formatting, added AppVersion custom message, and implemented GetSelectedComponents function for improved component selection handling.
2025-12-01 14:30:44 +09:00
a709031761 Refactor post-install script for modular component downloads
Introduces a DownloadUrls.psd1 manifest for component URLs and refactors postInstall.ps1 to support modular, architecture-aware downloads and installations. Adds selection logic for components, improves error handling, and updates setup.iss to support new GTK3 and GTK-server options. This change enables easier maintenance and extensibility for future components.
2025-12-01 14:17:03 +09:00
505801664a Refactor installer scripts and update components
Renamed afterInstall.ps1 to postInstall.ps1 and added telemetry support for PostHog. Updated Python embeddable package URLs to version 3.14.0. Revised setup.iss to improve component granularity, update author info, and integrate the new post-install script and telemetry parameters.
2025-12-01 12:29:46 +09:00
35fefc99e3
Merge pull request #352 from gnh1201/dev
Some checks failed
CodeQL / Analyze (javascript) (push) Has been cancelled
Deploy Jekyll with GitHub Pages dependencies preinstalled / build (push) Has been cancelled
Deploy Jekyll with GitHub Pages dependencies preinstalled / deploy (push) Has been cancelled
Update special channels section in README
2025-11-26 13:22:40 +09:00
6bbfa23946 Merge branch 'dev' of https://github.com/gnh1201/welsonjs into dev 2025-11-26 10:23:16 +09:00
24bb524910 Update special channels section in README
Clarified the paid consultation channel is for Korean customers and added a paid mentorship program for Korean students or beginners.
2025-11-26 10:23:12 +09:00
28b6c094d3
Merge pull request #351 from gnh1201/dev
Some checks are pending
CodeQL / Analyze (javascript) (push) Waiting to run
Deploy Jekyll with GitHub Pages dependencies preinstalled / build (push) Waiting to run
Deploy Jekyll with GitHub Pages dependencies preinstalled / deploy (push) Blocked by required conditions
Update README links and sponsor image URLs
2025-11-25 14:47:50 +09:00
58ff280bdf
Update README.md
Co-authored-by: sourcery-ai[bot] <58596630+sourcery-ai[bot]@users.noreply.github.com>
2025-11-25 14:07:05 +09:00
5c7a83b1b3
Update README.md
Co-authored-by: sourcery-ai[bot] <58596630+sourcery-ai[bot]@users.noreply.github.com>
2025-11-25 14:06:21 +09:00
3c9ba38242
Merge branch 'master' into dev 2025-11-25 14:06:04 +09:00
83c81c6bc5 Update README links and sponsor image URLs
Changed download and sponsor image URLs from ics.catswords.net to catswords.blob.core.windows.net. Updated HTTP client and AI integration descriptions for clarity and accuracy.
2025-11-25 14:04:54 +09:00
2056a59739
Merge pull request #350 from gnh1201/dev
Change the Image CDN
2025-11-25 11:31:27 +09:00
631757d9d9 Merge branch 'dev' of https://github.com/gnh1201/welsonjs into dev 2025-11-25 11:09:00 +09:00
3c1098bb7d Add alt text to WelsonJS logo in README
Improved accessibility by providing a descriptive alt attribute for the WelsonJS logo image in the README file.
2025-11-25 11:07:59 +09:00
830de5bb1d
Update README.md
Co-authored-by: sourcery-ai[bot] <58596630+sourcery-ai[bot]@users.noreply.github.com>
2025-11-25 11:04:03 +09:00
84231aad7d Update document links in SECURITY.MD
Changed URLs for certificate and escrow documents to point to the Azure Blob Storage location instead of the previous ics.catswords.net domain.
2025-11-25 11:03:34 +09:00
671c70a9a8 Update GUI screenshot image in README
Replaces the cover image link with a more specific screenshot for the GUI environment section in the README.
2025-11-25 10:55:51 +09:00
40d7dfb704 Update image URLs in README to new CDN
Replaced local and ics.catswords.net image links with catswords.blob.core.windows.net CDN URLs for logo, cover, and screenshots. Added a new screenshot for running .js files as executables.
2025-11-25 10:55:03 +09:00
efdce27b26
Merge pull request #349 from gnh1201/dev
Some checks failed
CodeQL / Analyze (javascript) (push) Has been cancelled
Deploy Jekyll with GitHub Pages dependencies preinstalled / build (push) Has been cancelled
Deploy Jekyll with GitHub Pages dependencies preinstalled / deploy (push) Has been cancelled
Refactor installer components and registry handling
2025-11-24 00:44:46 +09:00
Namhyeon, Go
342e5f4423 Update description for addtools component
Revised the description of the 'addtools' installation component to clarify that it includes additional tools and a Windows service for WelsonJS.
2025-11-24 00:39:44 +09:00
Namhyeon, Go
0dec23bc65 Refactor installer components and registry handling
Renamed 'downloadtools' and 'winservice' components to 'addtools' in setup.iss and updated related registry and icon entries to use the new component. Registry entries for script execution are now conditional on the 'addtools' component. Removed unnecessary 'pause' from uninstallService.bat for streamlined service removal.
2025-11-24 00:34:10 +09:00
28d66fd30f
Merge pull request #348 from gnh1201/dev
Release 0.2.7.56 Ready
2025-11-24 00:05:12 +09:00
4e25e13f35
Update lib/std.js
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
2025-11-23 23:59:20 +09:00
Namhyeon, Go
11fba0e3d0 Add WelsonJS JCTG feature to README
Documented the new WelsonJS JCTG (JavaScript-Click-To-Go) feature, allowing users to run WelsonJS scripts directly from Windows File Explorer by double-clicking, similar to `.exe` files.
2025-11-23 23:55:33 +09:00
Namhyeon, Go
bc686476b0 Merge branch 'dev' of https://github.com/gnh1201/welsonjs into dev 2025-11-23 23:46:41 +09:00
Namhyeon, Go
f43217e0b1 Add optional components to installer script
Introduces selectable components for file association, Windows Service module, and additional tool downloads in the installation process. Registry and install/uninstall actions are now conditioned on component selection, improving customization for users.
2025-11-23 23:46:07 +09:00
5dd68d8992
Update lib/std.js
Co-authored-by: sourcery-ai[bot] <58596630+sourcery-ai[bot]@users.noreply.github.com>
2025-11-23 23:32:27 +09:00
Namhyeon, Go
c4aed231da Update setup script metadata date
Changed the @updated_on field in setup.iss from 2025-11-21 to 2025-11-23 to reflect the latest modification.
2025-11-23 23:23:09 +09:00
Namhyeon, Go
84fd011e26 Revise test descriptions and tags for clarity
Improved the descriptions and tags for multiple test cases in test-oss-korea-2023.json to enhance clarity, consistency, and readability. Changes include standardizing terminology, correcting capitalization, and providing more precise explanations for each test.
2025-11-23 23:19:52 +09:00
227cd0f6d4 Deprecate Enumerator.toArray and update WMI version
Marked Enumerator.toArray as deprecated in favor of Array.from and updated its fallback implementation. Refactored lib/wmi.js to use Array.from instead of toArray, and bumped VERSIONINFO to 0.1.4. Modified setup.iss to add ScriptEngine and ScriptHostEncode registry entries and removed file associations for several script extensions.
2025-11-23 23:06:19 +09:00
6af55ec007
Merge pull request #347 from gnh1201/dev
Some checks failed
CodeQL / Analyze (javascript) (push) Has been cancelled
Deploy Jekyll with GitHub Pages dependencies preinstalled / build (push) Has been cancelled
Deploy Jekyll with GitHub Pages dependencies preinstalled / deploy (push) Has been cancelled
Refactor install script and add websocat support
2025-11-21 19:29:35 +09:00
a51e9ff1b4 Update launcher path in registry command
Changed the registry command for opening scripts to reference WelsonJS.Launcher.exe in the 'bin' subdirectory instead of the root application directory. This ensures the correct executable path is used after installation.
2025-11-21 19:17:05 +09:00
77dc2b88c5 Update user data directory logic and version info
Replaced usage of SYS.getEnvString("APPDATA") with SYS.getAppDataDir() for determining the user data directory. Updated VERSIONINFO to 0.5.4 to reflect the change.
2025-11-21 19:11:08 +09:00
5d907e3869 Update app data directory path and version info
Changed the app data directory from 'WelsonJS' to 'welsonjs' for consistency. Bumped VERSIONINFO to 0.1.7 to reflect the update.
2025-11-21 19:07:02 +09:00
fd3a34fc20 Update websocket.js for improved path handling
Refactored default WebSocket executable path selection to check for a user-specific installation before falling back to architecture-based defaults. Updated comments for clarity and incremented version to 0.2.4.
2025-11-21 18:57:23 +09:00
49ebde6835 Improve error handling in afterInstall.ps1
Enhanced error reporting by checking if caught errors are System.Exception and printing the appropriate message. This provides clearer output for both exception and non-exception error types during file download, extraction, and main script execution.
2025-11-21 17:57:18 +09:00
9b6fa4d233
Update afterInstall.ps1
Co-authored-by: qodo-merge-pro[bot] <151058649+qodo-merge-pro[bot]@users.noreply.github.com>
2025-11-21 16:55:27 +09:00
f2f16d7488
Update afterInstall.ps1
Co-authored-by: qodo-merge-pro[bot] <151058649+qodo-merge-pro[bot]@users.noreply.github.com>
2025-11-21 16:52:16 +09:00
ef966dfe1d Refactor install script and add websocat support
Refactored helper functions for clarity and consistency, including renaming and parameter changes. Added support for downloading and installing websocat, updated artifact URLs and extraction logic, and improved architecture-specific handling for optional tools. Enhanced output messages and error handling throughout the script.
2025-11-21 16:05:39 +09:00
4f6040d260
Merge pull request #346 from gnh1201/dev
Some checks failed
Deploy Jekyll with GitHub Pages dependencies preinstalled / build (push) Waiting to run
Deploy Jekyll with GitHub Pages dependencies preinstalled / deploy (push) Blocked by required conditions
CodeQL / Analyze (javascript) (push) Has been cancelled
Improve the installation process
2025-11-21 12:00:40 +09:00
cc86267471 Update launcher path in registry and shortcut
Changed the registry command and Start Menu shortcut to reference WelsonJS.Launcher.exe in the user app data directory, ensuring correct file location and execution.
2025-11-21 11:53:25 +09:00
Namhyeon, Go
c75859b350 Enable registry section in setup script
Uncommented the [Registry] section in setup.iss to allow registry entries to be created during installation. This change is necessary for proper file association and protocol handling.
2025-11-21 11:31:00 +09:00
15e6596285 Fix EXE_PATH case in service scripts
Updated the EXE_PATH variable in both installService.bat and uninstallService.bat to use 'welsonjs' instead of 'WelsonJS' for consistency and to avoid potential path issues.
2025-11-21 11:01:10 +09:00
ca8bd275bf Update service paths and installer registry keys
Service executable paths in installService.bat and uninstallService.bat now use %APPDATA% for improved portability. The setup.iss installer script updates registry keys to use the application name macro, adjusts file and icon paths to user appdata, and changes PowerShell execution flags. afterInstall.ps1 now downloads and extracts WelsonJS binary artifacts from a remote URL.
2025-11-21 10:50:31 +09:00
8e1ef781e7
Merge pull request #345 from gnh1201/dev
Add afterInstall.ps1 to installer sources
2025-11-21 10:11:44 +09:00
54a76f7078 Add afterInstall.ps1 to installer sources
Included afterInstall.ps1 in the setup script to ensure it is copied to the application directory during installation.
2025-11-20 17:34:24 +09:00
2317be5c49
Merge pull request #343 from gnh1201/dev
Some checks are pending
CodeQL / Analyze (javascript) (push) Waiting to run
Deploy Jekyll with GitHub Pages dependencies preinstalled / build (push) Waiting to run
Deploy Jekyll with GitHub Pages dependencies preinstalled / deploy (push) Blocked by required conditions
Support the file association registration for WelsonJS supported file types
2025-11-20 17:32:57 +09:00
2e92255a3c Use 'using' statement for InstancesForm disposal
Replaces manual disposal of InstancesForm with a 'using' statement to ensure proper resource management and exception safety when recording to the metadata database.
2025-11-20 17:31:50 +09:00
4bd05fd2a2
Update afterInstall.ps1
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
2025-11-20 17:26:11 +09:00
186561639e Add FILE module import and init PythonObject
Imported the FILE module in python3.js and updated PythonObject to initialize the default Python binary path upon creation. Also removed the copyright year range from the file header.
2025-11-20 17:24:26 +09:00
1a75388a69 Fix relative path calculation in file copy loop
Normalizes source directory path before calculating relative file paths to ensure correct substring indexing and prevent off-by-one errors when copying files.
2025-11-20 17:21:47 +09:00
b3b00771c5 Refactor zip file run logic in MainForm
Removed the _filePath field and refactored zip file handling to pass file paths directly as parameters. Simplified the RunAppPackageFile workflow and eliminated redundant methods for improved clarity and maintainability.
2025-11-20 17:14:49 +09:00
afe7d6213a Refactor deploy time recording and improve instance setup
Moved RecordFirstDeployTime from MainForm to Program for better separation of concerns. Updated instance directory creation and asset copying logic in Program.cs to support JS entrypoints, including library copying and first deploy time recording. Added a sleep call to helloworld.js for demonstration purposes.
2025-11-20 17:09:43 +09:00
33c64d50c9 Add afterInstall.ps1 and update tool paths to APPDATA
Introduces afterInstall.ps1 for post-install setup, downloading and extracting required tools to the APPDATA\WelsonJS directory. Updates code in http.js, python3.js, ovftool.js, wamr.js, and system.js to reference binaries from the new APPDATA location. Modifies setup.iss to run the PowerShell script after installation.
2025-11-20 16:44:20 +09:00
6f172aafe1 Revert "Enable COM interop registration in project config"
This reverts commit 4fb7b95c0e.
2025-11-20 14:56:59 +09:00
ce2e6fe103
Merge pull request #344 from gnh1201/dependabot/npm_and_yarn/js-yaml-4.1.1
Some checks are pending
CodeQL / Analyze (javascript) (push) Waiting to run
Deploy Jekyll with GitHub Pages dependencies preinstalled / build (push) Waiting to run
Deploy Jekyll with GitHub Pages dependencies preinstalled / deploy (push) Blocked by required conditions
Bump js-yaml from 4.1.0 to 4.1.1
2025-11-20 09:39:31 +09:00
54293b89b6
Update README.md
Some checks are pending
CodeQL / Analyze (javascript) (push) Waiting to run
Deploy Jekyll with GitHub Pages dependencies preinstalled / build (push) Waiting to run
Deploy Jekyll with GitHub Pages dependencies preinstalled / deploy (push) Blocked by required conditions
2025-11-19 14:34:31 +09:00
7a49694ff7
Update README.md 2025-11-19 14:33:10 +09:00
d156e40e6b Add Korea business area code checker example
Refactored korea_business_areacode.json to include metadata and expanded area code data. Added korea_biz_area_checker.js example script to read Excel files and match business numbers to area names using the updated area code data.
2025-11-19 12:23:22 +09:00
f86ea078c6 Add new file to .gitignore
Added do_not_push_production_on_friday.js to .gitignore to prevent accidental commits of this file.
2025-11-19 10:26:53 +09:00
9c9f865026 Add Korea business area code JSON data
Introduces a new data file containing business area codes for various regions in Korea. This will be used for region-based business logic or lookups.
2025-11-19 10:19:57 +09:00
0e40d890bf Merge branch 'dev' of https://github.com/gnh1201/welsonjs into dev 2025-11-19 09:52:37 +09:00
daea458f64
Update WelsonJS.Toolkit/WelsonJS.Launcher/Program.cs
Co-authored-by: qodo-merge-pro[bot] <151058649+qodo-merge-pro[bot]@users.noreply.github.com>
2025-11-16 18:58:48 +09:00
c392b6a08a
Update WelsonJS.Toolkit/WelsonJS.Launcher/MainForm.cs
Co-authored-by: qodo-merge-pro[bot] <151058649+qodo-merge-pro[bot]@users.noreply.github.com>
2025-11-15 20:39:11 +09:00
dependabot[bot]
bf3e6ebcf2
Bump js-yaml from 4.1.0 to 4.1.1
Bumps [js-yaml](https://github.com/nodeca/js-yaml) from 4.1.0 to 4.1.1.
- [Changelog](https://github.com/nodeca/js-yaml/blob/master/CHANGELOG.md)
- [Commits](https://github.com/nodeca/js-yaml/compare/4.1.0...4.1.1)

---
updated-dependencies:
- dependency-name: js-yaml
  dependency-version: 4.1.1
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-11-15 10:58:07 +00:00
a03ea7f3b3
Update WelsonJS.Toolkit/WelsonJS.Launcher/Program.cs
Co-authored-by: sourcery-ai[bot] <58596630+sourcery-ai[bot]@users.noreply.github.com>
2025-11-15 18:23:02 +09:00
c677c6907a Add CLI support for running script and zip files
Launcher now accepts a --file argument to run .js or .zip files directly from the command line. MainForm and Program.cs were refactored to support this, including new registry entries in setup.iss for file associations with WelsonJS Script extensions.
2025-11-15 18:08:47 +09:00
4fb7b95c0e Enable COM interop registration in project config
Added <RegisterForComInterop>True</RegisterForComInterop> to all build configurations in WelsonJS.Cryptography.vbproj to support COM interop registration for both Debug and Release builds.
2025-11-10 09:47:17 +09:00
Namhyeon, Go
ba7b3e3685 Revert "Merge pull request #340 from gnh1201/codex/create-winforms-for-websocket-management"
This reverts commit d71adb8001, reversing
changes made to 83b8e453f0.
2025-11-02 18:17:59 +09:00
d71adb8001
Merge pull request #340 from gnh1201/codex/create-winforms-for-websocket-management
Add WinForms interface for WebSocket management
2025-11-02 18:12:37 +09:00
Namhyeon, Go
cfcfaf3e1f Add WinForms interface for WebSocket management 2025-11-02 18:09:59 +09:00
Namhyeon, Go
e9cc898608 Revert "Merge pull request #339 from gnh1201/codex/abstract-connection-management-for-serial-port"
Some checks failed
CodeQL / Analyze (javascript) (push) Has been cancelled
Deploy Jekyll with GitHub Pages dependencies preinstalled / build (push) Has been cancelled
Deploy Jekyll with GitHub Pages dependencies preinstalled / deploy (push) Has been cancelled
This reverts commit a638a7a6e9, reversing
changes made to cab9013f18.
2025-11-02 17:59:10 +09:00
a638a7a6e9
Merge pull request #339 from gnh1201/codex/abstract-connection-management-for-serial-port
Abstract connection management and add serial port support
2025-11-02 17:36:39 +09:00
Namhyeon, Go
4489c31509 Guard serial reads with timeout-based termination and cap 2025-10-28 16:36:58 +09:00
Namhyeon, Go
9f4219e971 Make serial buffer resets optional and improve receive loop 2025-10-28 14:12:44 +09:00
Namhyeon, Go
3ce8d12628 Include timeouts in serial connection key 2025-10-28 14:12:37 +09:00
Namhyeon, Go
7795946f9f Serialize per-key operations 2025-10-28 14:12:31 +09:00
Namhyeon, Go
c7890aaadb Serialize connection creation per key 2025-10-28 14:12:25 +09:00
Namhyeon, Go
b8362e570c Add connection monitor for managed transports 2025-10-28 13:42:35 +09:00
Namhyeon, Go
6e759008dd Abstract connection management and add serial port support 2025-10-28 13:30:48 +09:00
cab9013f18
Merge pull request #337 from gnh1201/dev
Some checks failed
CodeQL / Analyze (javascript) (push) Has been cancelled
Deploy Jekyll with GitHub Pages dependencies preinstalled / build (push) Has been cancelled
Deploy Jekyll with GitHub Pages dependencies preinstalled / deploy (push) Has been cancelled
Rename getFilesFromFolder to getFiles and deprecate old name
2025-10-15 17:38:03 +09:00
83b8e453f0 Rename getFilesFromFolder to getFiles and deprecate old name
Renamed the getFilesFromFolder function to getFiles for clarity. The original getFilesFromFolder is now marked as deprecated and calls the new function, with a warning. Updated exports to reflect the change and bumped version to 0.2.17.
2025-10-13 16:23:03 +09:00
de08a5c527
Merge pull request #336 from gnh1201/dev
Some checks failed
CodeQL / Analyze (javascript) (push) Has been cancelled
Deploy Jekyll with GitHub Pages dependencies preinstalled / build (push) Has been cancelled
Deploy Jekyll with GitHub Pages dependencies preinstalled / deploy (push) Has been cancelled
Add isAbsolutePath utility and update path handling
2025-10-13 15:17:55 +09:00
b6a95a7c50 Refactor path normalization and absolute path check
Introduced a new normalizePath function in file.js to handle path trimming and BOM removal. Updated isAbsolutePath to use normalizePath for more robust path checking. Modified msoffice.js to use isAbsolutePath instead of manual string checks for determining absolute paths.
2025-10-13 15:12:52 +09:00
7cba7895fd Add isAbsolutePath utility and update path handling
Introduced isAbsolutePath function in file.js to robustly check for absolute paths. Updated msoffice.js to use this utility for file path resolution in Excel.open, improving cross-platform compatibility and reliability. Version numbers incremented in both files.
2025-10-13 14:55:10 +09:00
065f59eb4e
Merge pull request #335 from gnh1201/dev
Some checks failed
CodeQL / Analyze (javascript) (push) Has been cancelled
Deploy Jekyll with GitHub Pages dependencies preinstalled / build (push) Has been cancelled
Deploy Jekyll with GitHub Pages dependencies preinstalled / deploy (push) Has been cancelled
Add editor and community buttons with icons to MainForm
2025-10-10 13:52:18 +09:00
90806493ed Refactor code editor launch logic
Extracted the code editor launch logic into a new LaunchEditor() method to reduce duplication. Both the button and menu item now use this method, and error handling for resource server startup is centralized.
2025-10-10 12:18:47 +09:00
a77c83736c Add editor and community buttons with icons to MainForm
Replaced the community link label with a button featuring an icon, and added a new button to start the editor with its own icon. Updated resource files and designer code to support these changes, and adjusted related event handlers and UI text for clarity.
2025-10-10 12:07:16 +09:00
deefa25ada
Update README.md
Some checks are pending
CodeQL / Analyze (javascript) (push) Waiting to run
Deploy Jekyll with GitHub Pages dependencies preinstalled / build (push) Waiting to run
Deploy Jekyll with GitHub Pages dependencies preinstalled / deploy (push) Blocked by required conditions
2025-10-10 09:45:49 +09:00
a4eff4a1fa
Update README.md 2025-10-10 09:45:00 +09:00
4239353a44
Update README.md 2025-10-10 09:43:24 +09:00
93b12d2134
Merge pull request #334 from gnh1201/dev
Some checks are pending
CodeQL / Analyze (javascript) (push) Waiting to run
Deploy Jekyll with GitHub Pages dependencies preinstalled / build (push) Waiting to run
Deploy Jekyll with GitHub Pages dependencies preinstalled / deploy (push) Blocked by required conditions
Add CORS support to ResourceServer
2025-10-10 01:25:29 +09:00
ebe7b605cb Add Vary: Origin header and use Response.Close
Sets the 'Vary' header to 'Origin' for CORS responses to improve cache behavior. Replaces OutputStream.Close with Response.Close for proper response handling.
2025-10-09 22:04:27 +09:00
b32801c1c9 clean up the code
clean up the code
2025-10-09 21:14:41 +09:00
33d8fadc8f
Update WelsonJS.Toolkit/WelsonJS.Launcher/ResourceServer.cs
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
2025-10-04 19:39:58 +09:00
cd3e18a4c1 Merge branch 'dev' of https://github.com/gnh1201/welsonjs into dev 2025-10-04 18:11:15 +09:00
49263bb0ac Refactor CORS allowed origins initialization
Replaces GetAllowedOrigins with TryParseAllowedOrigins to initialize allowed origins once during static construction. Adds logging for invalid ResourceServerPrefix values and stores allowed origins in a static field for improved efficiency.
2025-10-04 18:09:03 +09:00
6e499bcedf
Update WelsonJS.Toolkit/WelsonJS.Launcher/ResourceServer.cs
Co-authored-by: sourcery-ai[bot] <58596630+sourcery-ai[bot]@users.noreply.github.com>
2025-10-03 17:49:10 +09:00
8ab70208d0
Update WelsonJS.Toolkit/WelsonJS.Launcher/ResourceServer.cs
Co-authored-by: qodo-merge-pro[bot] <151058649+qodo-merge-pro[bot]@users.noreply.github.com>
2025-10-03 17:48:25 +09:00
a745b6d0a7
Update WelsonJS.Toolkit/WelsonJS.Launcher/ResourceServer.cs
Co-authored-by: qodo-merge-pro[bot] <151058649+qodo-merge-pro[bot]@users.noreply.github.com>
2025-10-03 17:47:01 +09:00
b9e39dd9c7 Add CORS support to ResourceServer
Implemented CORS handling in ResourceServer, including preflight (OPTIONS) request handling and configurable allowed origins via the new ResourceServerAllowOrigins app setting. Updated resources and configuration files to support the new setting.
2025-10-03 17:35:34 +09:00
3542dc24b4
Merge pull request #333 from gnh1201/dev
Some checks failed
CodeQL / Analyze (javascript) (push) Has been cancelled
Deploy Jekyll with GitHub Pages dependencies preinstalled / build (push) Has been cancelled
Deploy Jekyll with GitHub Pages dependencies preinstalled / deploy (push) Has been cancelled
Refactor IP query to support multiple providers
2025-10-02 14:46:37 +09:00
8cfff666e4
Update WelsonJS.Toolkit/WelsonJS.Launcher/ResourceTools/IpQuery.cs
Co-authored-by: sourcery-ai[bot] <58596630+sourcery-ai[bot]@users.noreply.github.com>
2025-10-02 14:44:22 +09:00
5fb255e1e3 Refactor IP query to support multiple providers
Replaces the single CriminalIP API integration with a new IP query system supporting both CriminalIP and AbuseIPDB providers. Updates configuration keys, resource files, and the editor UI to handle multiple API endpoints and keys. Refactors backend logic to aggregate and return results from both providers in a unified XML format, and updates the frontend to parse and display these results. Adds improved error handling and logging for IP query and WHOIS operations.
2025-10-02 14:39:50 +09:00
cded75e491
Merge pull request #331 from gnh1201/dev
Some checks are pending
CodeQL / Analyze (javascript) (push) Waiting to run
Deploy Jekyll with GitHub Pages dependencies preinstalled / build (push) Waiting to run
Deploy Jekyll with GitHub Pages dependencies preinstalled / deploy (push) Blocked by required conditions
Add Chromium app mode and update executable config keys
2025-10-01 13:27:03 +09:00
a3e00d1762 Add Chromium app mode and update executable config keys
Introduces a new 'ChromiumAppMode' configuration option to launch Chromium in app mode when enabled. Renames 'ChromiumFileName' to 'ChromiumExecutablePath' in both code and configuration for clarity and consistency.
2025-10-01 13:23:27 +09:00
058edb28eb
Merge pull request #330 from gnh1201/dev
Some checks failed
CodeQL / Analyze (javascript) (push) Has been cancelled
Deploy Jekyll with GitHub Pages dependencies preinstalled / build (push) Has been cancelled
Deploy Jekyll with GitHub Pages dependencies preinstalled / deploy (push) Has been cancelled
Improve TraceLogger with file-based logging and fallback
2025-09-28 21:38:49 +09:00
a35e101f23 Refactor log file naming and improve Format method
Changed log file naming to use <Namespace>.<random-6>.<PID>.log instead of including 'pid' in the filename. Moved file stream creation inside the Trace listener check. Reformatted and clarified the Format method for better readability and error handling.
2025-09-28 20:14:00 +09:00
ce84aab861 Improve TraceLogger with file-based logging and fallback
TraceLogger now writes logs to a file in %APPDATA%\WelsonJS\Logs with a randomized suffix and process ID. If the log directory cannot be created, it falls back to the current directory. The logger also improves formatting and random suffix generation for log file names.
2025-09-28 19:59:45 +09:00
a0360c3d06
Fix broken "rdbl.io" links
Some checks are pending
CodeQL / Analyze (javascript) (push) Waiting to run
Deploy Jekyll with GitHub Pages dependencies preinstalled / build (push) Waiting to run
Deploy Jekyll with GitHub Pages dependencies preinstalled / deploy (push) Blocked by required conditions
Fix broken "rdbl.io" links
2025-09-28 15:24:28 +09:00
2b286aaea0
Merge pull request #329 from gnh1201/dev
Some checks are pending
CodeQL / Analyze (javascript) (push) Waiting to run
Deploy Jekyll with GitHub Pages dependencies preinstalled / build (push) Waiting to run
Deploy Jekyll with GitHub Pages dependencies preinstalled / deploy (push) Blocked by required conditions
Add ImageColorPicker tool and async resource serving
2025-09-28 03:22:22 +09:00
676f791fab Add ImageColorPicker tool and async resource serving
Introduces the ImageColorPicker resource tool for extracting color information from images via a POST API. Refactors ResourceServer and all resource tools to use async ServeResource methods, improving scalability and consistency. Updates JsSerializer with an engine-backed document store for efficient repeated JSON extraction.
2025-09-28 03:03:19 +09:00
ccfd8c37ea
Merge pull request #328 from gnh1201/dev
ChakraCore and JS (like a JSON) serialization
2025-09-28 01:43:08 +09:00
b1b36744cf
Merge branch 'master' into dev 2025-09-28 01:31:11 +09:00
9547d245b7
Update WelsonJS.Toolkit/WelsonJS.Launcher/JsSerializer.cs
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
2025-09-28 01:06:40 +09:00
91f19bc148
Update WelsonJS.Toolkit/WelsonJS.Launcher/Program.cs
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
2025-09-28 01:02:35 +09:00
2db47bca9a Add optional Authenticode signature validation for native DLLs
Enhanced NativeBootstrap to support optional Authenticode signature validation and custom certificate validators when loading native libraries. Added 'NativeRequireSigned' configuration to app.config and resources, allowing signature enforcement to be toggled. Updated Program.cs to use the new option during initialization.
2025-09-28 00:48:58 +09:00
87020d35ac Refactor logger interface and add JsNative interop layer
Updated ICompatibleLogger to accept params object[] for flexible logging. Refactored TraceLogger to support the new interface and improved formatting. Added JsNative.cs to encapsulate ChakraCore P/Invoke interop, and updated JsCore to use JsNative for all native calls. Modified all resource tools to accept and use ICompatibleLogger for consistent logging. Updated project file to include new and updated sources.
2025-09-28 00:07:41 +09:00
83a037dfa2 Download setup and ChakraCore in AppVeyor build
Added PowerShell steps to download the unsigned setup executable and ChakraCore.dll into the artifacts directory during the AppVeyor after_build phase.
2025-09-27 22:52:13 +09:00
3fe04d1113 Fix submodule gitlink for ChakraCore 2025-09-27 13:01:18 +09:00
4af01706de Add .gitmodules for ChakraCore submodule
Introduces a .gitmodules file to track the ChakraCore submodule under WelsonJS.Toolkit/ChakraCore, referencing the official ChakraCore repository.
2025-09-26 17:13:39 +09:00
130a6fd767 Add ChakraCore integration and native bootstrap logic
Introduces JsCore for ChakraCore P/Invoke, JsSerializer for JSON utilities via JS, and NativeBootstrap for robust native DLL loading. Updates Program.cs to initialize native dependencies at startup and registers new source files in the project file.
2025-09-26 17:04:14 +09:00
376fd8f852
Merge pull request #327 from gnh1201/dev
Some checks failed
CodeQL / Analyze (javascript) (push) Has been cancelled
Deploy Jekyll with GitHub Pages dependencies preinstalled / build (push) Has been cancelled
Deploy Jekyll with GitHub Pages dependencies preinstalled / deploy (push) Has been cancelled
Rename CitiQuery to IpQuery and update API references
2025-09-25 15:39:15 +09:00
849470555a
Update WelsonJS.Toolkit/WelsonJS.Launcher/ResourceTools/IpQuery.cs
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
2025-09-25 15:37:16 +09:00
90d623be95 Rename CitiQuery to IpQuery and update API references
Renamed the CitiQuery tool and related files to IpQuery for clarity. Updated all references from CitiApiKey and CitiApiPrefix to CriminalIpApiKey and CriminalIpApiPrefix in code, resources, and UI. Adjusted the editor UI and backend to use the new naming and API configuration.
2025-09-25 15:26:24 +09:00
2f399d0557
Merge pull request #323 from gnh1201/dev
Some checks failed
CodeQL / Analyze (javascript) (push) Has been cancelled
Deploy Jekyll with GitHub Pages dependencies preinstalled / build (push) Has been cancelled
Deploy Jekyll with GitHub Pages dependencies preinstalled / deploy (push) Has been cancelled
Refactor logging and resource server initialization
2025-08-26 13:07:20 +09:00
e9d475ba4c Improve resource server initialization and mutex handling
Adds a null check for the resource server after initialization and logs an error if it fails. Changes duplicate launcher instance log from error to info, and wraps mutex release in a try-catch to prevent exceptions if not owned.
2025-08-26 13:02:32 +09:00
f3db44d8e3 Fix mutex variable naming in Program.cs
Renamed the out variable from '_createdNew' to 'createdNew' for clarity and updated its usage in the mutex check. This improves code readability and consistency.
2025-08-26 12:55:39 +09:00
ecbe55cf80 Rename mutex out parameter for clarity
Changed the out parameter name from 'mutexNotExists' to '_createdNew' in the Mutex constructor for improved readability and clarity in the Main method.
2025-08-26 12:55:07 +09:00
d3ecbd7ebe Fix mutex logic for single instance check
Renamed variable to clarify mutex existence and corrected the condition to properly detect if the launcher is already running.
2025-08-26 12:53:48 +09:00
57d0454051 Refactor logging and resource server initialization
Introduces ICompatibleLogger for improved logging, replaces Trace.TraceError and Trace.TraceInformation calls with logger methods, and standardizes ResourceServer instance naming to _resourceServer. Passes logger instances to MainForm and ResourceServer for consistent logging. Also refactors mutex handling and initialization logic for clarity.
2025-08-26 12:49:37 +09:00
3865f3216f
Merge pull request #322 from gnh1201/dev
Some checks are pending
CodeQL / Analyze (javascript) (push) Waiting to run
Deploy Jekyll with GitHub Pages dependencies preinstalled / build (push) Waiting to run
Deploy Jekyll with GitHub Pages dependencies preinstalled / deploy (push) Blocked by required conditions
Add abnormal case check to clusteredCellsDensity
2025-08-26 10:07:51 +09:00
78ab8d839f Add abnormal case check to clusteredCellsDensity
Returns false if more than one third of the grid is selected, treating it as an abnormal case. Also updates VERSIONINFO to 1.0.4.
2025-08-25 01:39:42 +09:00
cc08f7b362
Merge pull request #321 from gnh1201/dev
Some checks failed
CodeQL / Analyze (javascript) (push) Has been cancelled
Deploy Jekyll with GitHub Pages dependencies preinstalled / build (push) Has been cancelled
Deploy Jekyll with GitHub Pages dependencies preinstalled / deploy (push) Has been cancelled
TOTP (Time-based OTP) with 32 characters key
2025-08-22 23:28:01 +09:00
d443f6270c Update OTP endpoint and version info in totp.js
Changed the OTP API endpoint from '/tfa/otp' to '/otp' and updated VERSIONINFO to 1.0.1. Improved example comments to clarify key formats and OTP code usage.
2025-08-22 17:59:32 +09:00
dfc18cfd7d Refactor TFA tool to TwoFactorAuth and update TOTP client
Renamed ResourceTools/Tfa.cs to ResourceTools/TwoFactorAuth.cs and updated all references accordingly. Enhanced TwoFactorAuth with improved key handling, error responses, and form parsing. Updated totp.js to use the new local HTTP API endpoints for key generation and OTP calculation, removing legacy JSON-RPC code.
2025-08-22 17:21:31 +09:00
d3a122029d
Merge pull request #320 from gnh1201/dev
Some checks failed
CodeQL / Analyze (javascript) (push) Has been cancelled
Deploy Jekyll with GitHub Pages dependencies preinstalled / build (push) Has been cancelled
Deploy Jekyll with GitHub Pages dependencies preinstalled / deploy (push) Has been cancelled
Some bug fixes, and enhance ExtraMath module
2025-08-20 17:33:53 +09:00
8ff12c9883
Update lib/extramath.js
Co-authored-by: qodo-merge-pro[bot] <151058649+qodo-merge-pro[bot]@users.noreply.github.com>
2025-08-20 17:29:44 +09:00
1dd02f7a75
Update lib/extramath.js
Co-authored-by: sourcery-ai[bot] <58596630+sourcery-ai[bot]@users.noreply.github.com>
2025-08-20 17:25:51 +09:00
83b022bf6f Refactor grid functions and update exports in extramath.js
Improved clusteredCellsDensity to validate cell indices and refactored coordinate calculation to be 1-based. Replaced tileStartPos with estimateTileStartPosition for more flexible tile positioning, updated exports accordingly, and bumped VERSIONINFO to 1.0.3.
2025-08-20 17:10:58 +09:00
ab869556c4 Add tileStartPos function and update version
Introduced tileStartPos to calculate tile coordinates based on index, size, and columns. Updated VERSIONINFO to 1.0.1 and exported the new function.
2025-08-18 07:20:01 +09:00
717b141cb7 Add clusteredCellsDensity function to extramath.js
Introduces clusteredCellsDensity to evaluate density of selected cells within a grid. Updates module version to 1.0.0 and exports the new function for external use.
2025-08-18 04:16:52 +09:00
83fb136957 Remove redundant error handling in ChromeObject
Eliminated duplicate error response handling logic in ChromeObject and updated the version info to 0.5.3. Error messages are now handled solely by the catch block for cleaner code.
2025-08-18 03:26:27 +09:00
8da63c08ca Add setup file download to AppVeyor build
Some checks failed
CodeQL / Analyze (javascript) (push) Has been cancelled
Deploy Jekyll with GitHub Pages dependencies preinstalled / build (push) Has been cancelled
Deploy Jekyll with GitHub Pages dependencies preinstalled / deploy (push) Has been cancelled
A PowerShell command was added to download the unsigned setup executable from Azure Blob Storage during the after_build step, saving it to the artifacts directory.
2025-08-18 01:47:36 +09:00
df393ed251
Merge pull request #318 from gnh1201/dev
Improve logging and async handling in ResourceServer
2025-08-17 23:33:35 +09:00
a022383d63 Improve error handling for FetchBlobConfig
Replaces fire-and-forget async call to FetchBlobConfig with a safe pattern that logs errors if the task fails. This ensures exceptions are not silently ignored and improves reliability.
2025-08-17 22:34:31 +09:00
d0c031fe32 Fix async context handling in blob config loading
Added ConfigureAwait(false) to async HTTP call and moved Compile() invocation to immediately after deserialization. This improves async context handling and ensures blob config is compiled before assignment.
2025-08-17 21:22:17 +09:00
6896c272ef
Update WelsonJS.Toolkit/WelsonJS.Launcher/TraceLogger.cs
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
2025-08-17 20:58:08 +09:00
f44f56ea2c Refactor HTTP client usage in ResourceServer
Replaced local HttpClient instantiation with the class-level _httpClient for sending requests. This improves resource management and consistency in HTTP operations.
2025-08-17 20:43:33 +09:00
cc08c46886 Improve logging and async handling in ResourceServer
ResourceServer now defaults to using TraceLogger if no logger is provided and properly awaits FetchBlobConfig. FetchBlobConfig is refactored to return a Task and handle missing configuration more gracefully. TraceLogger now writes logs to a file named after its namespace and sets up a TextWriterTraceListener for persistent logging.
2025-08-17 20:12:38 +09:00
f413a5c4fa
Merge pull request #317 from gnh1201/dev
Some checks are pending
CodeQL / Analyze (javascript) (push) Waiting to run
Deploy Jekyll with GitHub Pages dependencies preinstalled / build (push) Waiting to run
Deploy Jekyll with GitHub Pages dependencies preinstalled / deploy (push) Blocked by required conditions
Add ICompatibleLogger interface and integrate logging
2025-08-17 11:24:05 +09:00
8ecdf99d78 Add ICompatibleLogger interface and integrate logging
Introduced ICompatibleLogger interface and TraceLogger implementation to enable flexible logging. ResourceServer now uses ICompatibleLogger for error reporting instead of Trace, improving testability and future extensibility. Updated project file to include new logger classes.
2025-08-16 21:23:16 +09:00
43ff486049
Merge pull request #316 from gnh1201/dev
Some checks failed
CodeQL / Analyze (javascript) (push) Has been cancelled
Deploy Jekyll with GitHub Pages dependencies preinstalled / build (push) Has been cancelled
Deploy Jekyll with GitHub Pages dependencies preinstalled / deploy (push) Has been cancelled
Refactor WebSocket communication logic
2025-08-14 04:44:48 +09:00
2068cdfeb3 Refactor WebSocket communication logic
Replaces manual WebSocket send/receive code with a single call to _wsManager.SendAndReceiveAsync for improved clarity and maintainability. Updates comments for better readability and removes redundant exception handling for OperationCanceledException.
2025-08-14 04:43:13 +09:00
0aa3b06e42
Merge pull request #315 from gnh1201/dev
Improve WebSocket receive buffer handling
2025-08-14 04:22:26 +09:00
6893eadd04 Improve WebSocket receive buffer handling
Refactored TrySendAndReceiveAsync to use a fixed-size buffer for I/O and dynamically accumulate received data chunks until EndOfMessage. This prevents truncation of large messages and ensures the entire payload is received before decoding.
2025-08-14 04:21:02 +09:00
d2069962bb
Merge pull request #314 from gnh1201/dev
Some checks are pending
CodeQL / Analyze (javascript) (push) Waiting to run
Deploy Jekyll with GitHub Pages dependencies preinstalled / build (push) Waiting to run
Deploy Jekyll with GitHub Pages dependencies preinstalled / deploy (push) Blocked by required conditions
Improve WebSocket receive to handle multi-frame messages
2025-08-14 04:02:23 +09:00
e1d90cde18 Improve WebSocket receive to handle multi-frame messages
The receive logic now accumulates all frames until EndOfMessage, ensuring complete messages are read even if fragmented. This change improves reliability when handling large or fragmented WebSocket messages.
2025-08-14 04:01:02 +09:00
6bf280d38f
Merge pull request #313 from gnh1201/revert-310-dev
Revert "Update WebSocketManager.cs"
2025-08-14 03:35:50 +09:00
Namhyeon, Go
c4582b651c
Revert "Update WebSocketManager.cs" 2025-08-14 03:35:41 +09:00
309217994e
Merge pull request #312 from gnh1201/revert-311-dev
Revert "Update WebSocketManager.cs (Urgent)"
2025-08-14 03:35:26 +09:00
Namhyeon, Go
3962e7a04b
Revert "Update WebSocketManager.cs (Urgent)" 2025-08-14 03:35:12 +09:00
b0cd9598eb
Merge pull request #311 from gnh1201/dev
Update WebSocketManager.cs (Urgent)
2025-08-14 03:19:52 +09:00
8bca089976
Update WebSocketManager.cs 2025-08-14 03:18:14 +09:00
e1a9c79a75
Merge pull request #310 from gnh1201/dev
Update WebSocketManager.cs
2025-08-14 03:13:53 +09:00
f1af7029fa
Update WebSocketManager.cs 2025-08-14 03:11:44 +09:00
bb1078dca8
Merge pull request #309 from gnh1201/dev
Some checks failed
CodeQL / Analyze (javascript) (push) Has been cancelled
Deploy Jekyll with GitHub Pages dependencies preinstalled / build (push) Has been cancelled
Deploy Jekyll with GitHub Pages dependencies preinstalled / deploy (push) Has been cancelled
Improve error handling in sendPageRPC and getEvaluatedValue
2025-08-11 04:58:36 +09:00
7a05916319 Improve error handling in ChromeObject
Enhanced error handling by returning a structured error object when exceptions occur in ChromeObject. Also updated the version info to 0.5.2.
2025-08-11 04:52:38 +09:00
1533059e44 Improve error handling in sendPageRPC and getEvaluatedValue
Refactored sendPageRPC to better handle error responses and log error descriptions from the response object. Updated getEvaluatedValue to safely access the evaluated value, returning an empty string if not present. Bumped VERSIONINFO to 0.5.1.
2025-08-11 02:58:33 +09:00
1b0f529f74
Update SECURITY.MD
Some checks failed
CodeQL / Analyze (javascript) (push) Has been cancelled
Deploy Jekyll with GitHub Pages dependencies preinstalled / build (push) Has been cancelled
Deploy Jekyll with GitHub Pages dependencies preinstalled / deploy (push) Has been cancelled
2025-08-08 08:38:53 +09:00
c58fe7e35c
Update README.md
Some checks failed
CodeQL / Analyze (javascript) (push) Has been cancelled
Deploy Jekyll with GitHub Pages dependencies preinstalled / build (push) Has been cancelled
Deploy Jekyll with GitHub Pages dependencies preinstalled / deploy (push) Has been cancelled
2025-08-05 18:14:02 +09:00
9e3b4f1c3c
Merge pull request #307 from gnh1201/dev
Introduce `UseObject(progId, callback)` and more fixes
2025-08-05 17:51:47 +09:00
665642586b
Fix indentation on lib/pipe-ipc.js
Fix indentation on lib/pipe-ipc.js
2025-08-05 17:48:13 +09:00
444b80e3b5
Update file.js 2025-08-05 17:45:46 +09:00
68a57f15fb
Update app.js 2025-08-05 17:44:34 +09:00
0ab35aab7c
Enable the worksheet activation on the screen
Enable the worksheet activation on the screen
2025-08-05 17:33:43 +09:00
6e89bda453
Remove makeInterface(<number>) and replace to UseObject(<string>)
Remove makeInterface(<number>) and replace to UseObject(<string>)
2025-08-05 17:31:48 +09:00
3de5b618db
Introduce getFilesFromFolder() and clean the code
Introduce getFilesFromFolder() and clean the code
2025-08-05 17:30:20 +09:00
1398c1b359
Intoduce UseObject(<string>, <function>) in app.js
Intoduce UseObject(<string>, <function>) in app.js
2025-08-05 17:28:38 +09:00
fe74f360d9
Introduce Array.form(<Enumerator>) polyfills
Introduce Array.form(<Enumerator>) polyfills
2025-08-05 16:39:44 +09:00
129a61299c
Merge pull request #306 from gnh1201/dev
Some checks are pending
CodeQL / Analyze (javascript) (push) Waiting to run
Deploy Jekyll with GitHub Pages dependencies preinstalled / build (push) Waiting to run
Deploy Jekyll with GitHub Pages dependencies preinstalled / deploy (push) Blocked by required conditions
Switch Chrome RPC from WebSocket to HTTP gateway
2025-08-05 05:37:22 +09:00
3f376d29c3 Switch Chrome RPC from WebSocket to HTTP gateway
Replaces WebSocket-based RPC communication with HTTP POST requests to a gateway for Chrome debugging. Updates documentation to clarify the need for a protocol conversion gateway and refactors related methods for compatibility. Bumps version to 0.5.
2025-08-05 05:34:22 +09:00
737ad97eff
Merge pull request #305 from gnh1201/dev
Update WebSocketManager.cs (Urgent fix)
2025-08-05 05:05:43 +09:00
ae7f79aeb8 Update WebSocketManager.cs 2025-08-05 05:01:54 +09:00
13cc674433
Merge pull request #304 from gnh1201/dev
Refactor WebSocketManager for improved clarity and reliability
2025-08-05 04:46:17 +09:00
57fae72f42 Refactor WebSocketManager for improved clarity and reliability
Renamed internal classes and fields for clarity, added comments, and refactored SendAndReceiveAsync to use a helper method and a retry mechanism. Improved resource cleanup and error handling for stale sockets. These changes enhance code readability and robustness in WebSocket connection management.
2025-08-05 04:33:18 +09:00
b33069fc9e Update WebSocketManager.cs 2025-08-05 04:26:30 +09:00
147ef3c21b
Merge pull request #303 from gnh1201/dev
Some checks failed
CodeQL / Analyze (javascript) (push) Has been cancelled
Deploy Jekyll with GitHub Pages dependencies preinstalled / build (push) Has been cancelled
Deploy Jekyll with GitHub Pages dependencies preinstalled / deploy (push) Has been cancelled
WebSocket support for DevTools protocol, and minor fixes
2025-07-31 17:35:02 +09:00
f9c265b08a Use MD5 hash for WebSocket connection keys
Replaces the plain concatenation of host, port, and path with an MD5 hash to generate unique keys for WebSocket connections. This improves key uniqueness and prevents potential issues with special characters in the key string.
2025-07-31 17:28:26 +09:00
92a35606ed Improve XML escaping, WebSocket buffer, and editor style
Replaced HTML encoding with SecurityElement.Escape for XML escaping in ChromiumDevTools. Made WebSocketManager's receive buffer size configurable with a default of 65536 bytes. Updated editor.html to use 'color: inherit' for banner link hover to maintain contrast.
2025-07-31 17:23:11 +09:00
837ab036a8 Enhance banner link style and text in editor.html
Added custom CSS for the banner link to improve appearance and hover effect. Updated the banner link text to include a heart emoji for better visual appeal.
2025-07-31 17:13:45 +09:00
14da9f90da Update editor.html 2025-07-31 17:08:29 +09:00
ed0a7eed3f Update banner link text in editor.html
Changed the banner text from 'WelsonJS Editor powered by Metro UI, Monaco Editor, and JSONEditor.' to 'Contribute this project' with a link to the project's GitHub repository.
2025-07-31 17:05:44 +09:00
7b49817182 Add WebSocket support for Chromium DevTools endpoints
Implemented WebSocket communication in ChromiumDevTools to support 'page/' endpoints, allowing bidirectional messaging with Chromium DevTools Protocol. Added timeout configuration, improved error handling, and refactored WebSocketManager for connection pooling and reconnection. Updated resources and configuration files to support new timeout settings. Also fixed editor.html to handle direct JSON responses for citi-query.
2025-07-31 16:59:03 +09:00
f9becf2c6d
Update README.md
Some checks failed
CodeQL / Analyze (javascript) (push) Has been cancelled
Deploy Jekyll with GitHub Pages dependencies preinstalled / build (push) Has been cancelled
Deploy Jekyll with GitHub Pages dependencies preinstalled / deploy (push) Has been cancelled
2025-07-29 11:15:25 +09:00
e28ed16494
Update SECURITY.MD 2025-07-29 11:12:49 +09:00
a7b4243aa9
Update SECURITY.MD 2025-07-29 11:08:12 +09:00
fb99c634e3
Update SECURITY.MD 2025-07-29 11:07:55 +09:00
db0174337c
Update README.md 2025-07-29 09:37:39 +09:00
a5ea9a69bd
Update SECURITY.MD
Some checks are pending
CodeQL / Analyze (javascript) (push) Waiting to run
Deploy Jekyll with GitHub Pages dependencies preinstalled / build (push) Waiting to run
Deploy Jekyll with GitHub Pages dependencies preinstalled / deploy (push) Blocked by required conditions
2025-07-28 11:20:37 +09:00
15f8cd6790
Update SECURITY.MD 2025-07-28 11:20:17 +09:00
e12f90b8bb
Merge pull request #302 from gnh1201/dev
Some checks are pending
CodeQL / Analyze (javascript) (push) Waiting to run
Deploy Jekyll with GitHub Pages dependencies preinstalled / build (push) Waiting to run
Deploy Jekyll with GitHub Pages dependencies preinstalled / deploy (push) Blocked by required conditions
Fix build error in AppVeyor
2025-07-27 23:19:49 +09:00
2b30e864f0 Update WelsonJS.Cryptography.Test.vbproj 2025-07-27 22:45:56 +09:00
6f3e4342fb Update .appveyor.yml 2025-07-27 22:30:25 +09:00
e579a341a4 Add WebSocketManager.cs and more
Add WebSocketManager.cs and more
2025-07-27 22:25:48 +09:00
782f1ebb28
Merge pull request #301 from gnh1201/master
Merge master to dev branch
2025-07-27 16:22:03 +09:00
9a328bff0b
Merge pull request #300 from gnh1201/cryptography
Some checks are pending
CodeQL / Analyze (javascript) (push) Waiting to run
Deploy Jekyll with GitHub Pages dependencies preinstalled / build (push) Waiting to run
Deploy Jekyll with GitHub Pages dependencies preinstalled / deploy (push) Blocked by required conditions
Add resource server autostart and Chromium config options
2025-07-27 16:17:10 +09:00
c3d68e1d2f Fix typo
Fix typo
2025-07-27 16:12:55 +09:00
2b4814ecb5 Add resource server autostart and Chromium config options
Introduces ResourceServerAutoStart and ChromiumFileName/ChromiumDevToolsPrefix settings to app.config and resources. Refactors resource server startup logic to support autostart and configurable browser launch. Cleans up related code in MainForm and Program for improved flexibility and maintainability.
2025-07-27 15:57:05 +09:00
bc43302e14
Merge pull request #299 from gnh1201/dev
Some checks are pending
CodeQL / Analyze (javascript) (push) Waiting to run
Deploy Jekyll with GitHub Pages dependencies preinstalled / build (push) Waiting to run
Deploy Jekyll with GitHub Pages dependencies preinstalled / deploy (push) Blocked by required conditions
Update file headers to reflect .vb extensions
2025-07-27 00:38:29 +09:00
5ee4a1f7b6
Merge pull request #298 from gnh1201/cryptography
Update file headers to reflect .vb extensions
2025-07-27 00:34:44 +09:00
3583415ee2 Update file headers to reflect .vb extensions
Changed file header comments in cryptography-related modules from '.cs' to '.vb' to accurately reflect the file types. This improves clarity and consistency in source file documentation.
2025-07-27 00:31:49 +09:00
786e4661a0
Merge pull request #297 from gnh1201/dev
Add WelsonJS.Cryptography package (SEED, ARIA, HIGHT algoritm)
2025-07-26 23:30:09 +09:00
453fc231d0
Merge pull request #296 from gnh1201/cryptography
Add `WelsonJS.Cryptography` package (SEED, ARIA, HIGHT algoritm)
2025-07-26 23:21:48 +09:00
5c1ffff822 Add license headers to cryptography classes
Added SPDX license and copyright headers to AriaCore and HightAlgorithm classes for compliance and documentation. Minor formatting adjustments in AriaAlgorithm and AriaEcbTransform to improve consistency.
2025-07-26 23:19:48 +09:00
0b73fe8b60 Offical test vector ALL PASSED: SEED, ARIA, HIGHT
Offical test vector ALL PASSED: SEED, ARIA, HIGHT algorithm
2025-07-26 23:12:31 +09:00
9d234e82dc Fix ARIA algorithm has failed #295 (TEST PASSED)
Fix ARIA algorithm has failed #295 (TEST PASSED)
2025-07-26 23:06:36 +09:00
76ebdbb7a8 try fix #295 (TEST FAILED)
try fix #295 (TEST FAILED)
2025-07-26 18:09:11 +09:00
3498f27619 Implement HIGHT algorithm with official test vector (TEST PASSED) #293
Implement HIGHT algorithm with official test vector (TEST PASSED) #293
2025-07-25 00:06:40 +09:00
2a8c4d196c Add HIGHT block cipher implementation #293
Implemented the HIGHT block cipher with ECB mode support, including HightAlgorithm, HightCore, and HightEcbTransform classes. Updated the test program to include HIGHT encryption/decryption tests and added support for PaddingMode.None in ARIA and SEED ECB transforms.
2025-07-20 19:49:52 +09:00
ec03bf415d Add ARIA cryptography algorithm
Add ARIA cryptography algorithm
2025-07-19 19:07:05 +09:00
90e0caf8d6
Merge pull request #292 from gnh1201/dev
Some checks failed
CodeQL / Analyze (javascript) (push) Has been cancelled
Deploy Jekyll with GitHub Pages dependencies preinstalled / build (push) Has been cancelled
Deploy Jekyll with GitHub Pages dependencies preinstalled / deploy (push) Has been cancelled
Update the contacts
2025-07-16 15:11:26 +09:00
2688765f84 Update the contacts 2025-07-16 13:57:04 +09:00
87f25b2d44
Create jekyll-gh-pages.yml
Some checks failed
CodeQL / Analyze (javascript) (push) Has been cancelled
Deploy Jekyll with GitHub Pages dependencies preinstalled / build (push) Has been cancelled
Deploy Jekyll with GitHub Pages dependencies preinstalled / deploy (push) Has been cancelled
2025-07-15 09:33:42 +09:00
db5607320a
Delete .github/workflows/static.yml 2025-07-15 09:32:01 +09:00
9337084fe4
Create static.yml 2025-07-15 09:29:17 +09:00
8bcbbbae4f
Merge pull request #291 from gnh1201/dev
Some checks are pending
CodeQL / Analyze (javascript) (push) Waiting to run
Update README.md
2025-07-14 16:06:43 +09:00
0cc3f30044 Update README.md 2025-07-14 15:48:33 +09:00
727c17576c
Create CNAME
Some checks are pending
CodeQL / Analyze (javascript) (push) Waiting to run
2025-07-14 09:38:10 +09:00
f9952000b4
Update README.md
Some checks are pending
CodeQL / Analyze (javascript) (push) Waiting to run
2025-07-13 15:01:38 +09:00
747d614da6
Merge pull request #288 from gnh1201/dev
Some checks failed
CodeQL / Analyze (javascript) (push) Has been cancelled
Update README.md
2025-07-11 09:30:32 +09:00
93d273ed54 Update README.md 2025-07-11 09:27:23 +09:00
7237b47703
Merge pull request #287 from gnh1201/dev
Replace the default SERP provider to SerpApi - Update README.md
2025-07-11 08:58:59 +09:00
f1188a32bb Replace the default SERP provider to SerpApi - Update README.md
Replace the default SERP provider to SerpApi - Update README.md
2025-07-11 08:55:49 +09:00
93228103e6
Merge pull request #286 from gnh1201/dev
Some checks are pending
CodeQL / Analyze (javascript) (push) Waiting to run
Replace the default SERP provider to SerpApi - Update README.md
2025-07-10 15:07:33 +09:00
be1f0e8e2d Replace the default SERP provider to SerpApi - Update README.md
Replace the default SERP provider to SerpApi - Update README.md
2025-07-10 15:04:25 +09:00
9424ec3427
Merge pull request #285 from gnh1201/dev
Replace the default SERP provider to SerpApi - Update README.md
2025-07-10 14:05:10 +09:00
23b82d953d Replace the default SERP provider to SerpApi - Update README.md
Replace the default SERP provider to SerpApi - Update README.md
2025-07-10 14:04:07 +09:00
0df87cda96
Merge pull request #284 from gnh1201/dev
Replace the default SERP provider to SerpApi
2025-07-10 14:00:50 +09:00
3f8a301680 Update apikey.json 2025-07-10 13:58:23 +09:00
01230745ed Update aviation.js 2025-07-10 13:57:19 +09:00
5ccba3b107 Replace the default SERP provider to SerpApi
Updated all references from the previous default SERP provider to SerpApi, including API keys, proxy configuration, and documentation links. Adjusted aviation.js to use SerpApi endpoints and parameters, and updated testloader.js to reflect the new provider. This change standardizes the search engine scraping integration to use SerpApi.
2025-07-10 13:54:53 +09:00
461e868c07
Delete .gitmodules #283 2025-07-10 13:00:35 +09:00
848a4359fa Fix SEED cryptography algorithm
Fix SEED cryptography algorithm
2025-07-09 11:20:54 +09:00
cb649c88ed Update SEED algorithm 2025-07-05 13:24:10 +09:00
63f009fb73 Add SEED algorithm test project for WelsonJS.Cryptography
Introduced a new test project 'WelsonJS.Cryptography.Test' with a Program.vb that tests SEED encryption and decryption. Updated the solution file to include both the cryptography library and its test project, and configured build settings for all platforms.
2025-07-04 23:53:03 +09:00
014c1eaa59
Update .appveyor.yml 2025-07-04 23:52:20 +09:00
9afb64a997 Add package WelsonJS.Cryptography
Add package `WelsonJS.Cryptography`
2025-07-04 23:43:09 +09:00
ea2c71a53d
Update .appveyor.yml 2025-07-04 10:21:27 +09:00
f227ce9f60
Update README.md 2025-07-03 09:49:19 +09:00
031a26ced6
Merge pull request #280 from gnh1201/dev
Update README.md (WelsonJS.Esent)
2025-06-26 10:57:03 +09:00
21f2187d17 Delete WelsonJS - Backup.Esent.csproj 2025-06-26 10:50:34 +09:00
cc31e9383e Update README.md (WelsonJS.Esent) 2025-06-26 10:49:40 +09:00
509eaac28c
Merge pull request #279 from gnh1201/dev
Update EsentDatabase specs
2025-06-26 10:32:03 +09:00
dcf966b2c5 Fix the null check for schema should occur before accessing schema.PrimaryKey 2025-06-26 10:26:59 +09:00
82df8c5605 Update EsentDatabase specs 2025-06-26 10:22:07 +09:00
c6f546778f
Merge pull request #278 from gnh1201/dev
Introduce ESENT database to WelsonJS Launcher
2025-06-25 15:43:55 +09:00
91ce125c7f Update MainForm.cs 2025-06-25 15:38:26 +09:00
aacc2414f2 ESENT completed #277 2025-06-25 00:19:56 +09:00
9d2fb432f7 Add the package ManagedEsent, and WelsonJS.Esent
Add the package ManagedEsent (microsoft/ManagedEsent@d358c07), and WelsonJS.Esent
2025-06-24 17:55:34 +09:00
62d219f443 ESENT: Add method CreateIndex
The index creation process has been separated into a dedicated method to improve readability and stability.
2025-06-24 11:30:27 +09:00
3e4b6a73b5 Fix the index creation failure 2025-06-23 18:15:37 +09:00
ece369f8f0 Revert "Update MetadataStore.cs"
This reverts commit ba3e21feca.
2025-06-23 18:04:39 +09:00
ba3e21feca Update MetadataStore.cs 2025-06-23 17:40:02 +09:00
0cb0f9303d ESENT: fix the index creation failure #277 2025-06-23 17:36:03 +09:00
dfef7a622f ESENT: try 2 2025-06-22 22:27:42 +09:00
7aa70a2eeb Try to apply ESENT database #277 2025-06-21 18:33:38 +09:00
b4773646c2
Update README.md 2025-06-20 15:58:32 +09:00
0499a126d9
Merge pull request #276 from gnh1201/dev
[lib/chrome] Update the `--disabled-features` flag
2025-06-19 09:41:16 +09:00
2aa6fdc256 Update chrome.js 2025-06-18 15:25:32 +09:00
9b6270ff72 Update chrome.js 2025-06-18 14:56:20 +09:00
2ee3a2f55a
Merge pull request #275 from gnh1201/dev
Some checks failed
CodeQL / Analyze (javascript) (push) Has been cancelled
Fix #274
2025-06-13 23:16:40 +09:00
526eb92e61 Update chrome.js 2025-06-13 22:16:43 +09:00
670f82fc05
Merge pull request #272 from gnh1201/dev
Some checks failed
CodeQL / Analyze (javascript) (push) Has been cancelled
Fix #271
2025-06-08 18:00:31 +09:00
cace5c60b3 Update chrome.js 2025-06-08 17:57:58 +09:00
044ab2fb24 Update std.js 2025-06-08 17:47:52 +09:00
f2de8bc141 Fix #271 2025-06-08 17:43:25 +09:00
f37516e4ae
Merge pull request #270 from gnh1201/dev
Update chrome.js
2025-06-08 16:48:26 +09:00
bbc3aa9a6e Update chrome.js 2025-06-07 18:10:29 +09:00
3e4bf1d1ed
Merge pull request #269 from gnh1201/dev
Some checks are pending
CodeQL / Analyze (javascript) (push) Waiting to run
Update license headers, contact email, and fix broken files
2025-06-07 17:04:19 +09:00
f911e34c16 Update license headers, contact email, and fix broken files 2025-06-07 16:57:09 +09:00
a1eeb31070
Merge pull request #268 from gnh1201/dev
Some checks are pending
CodeQL / Analyze (javascript) (push) Waiting to run
Introduce the accessor and improve the CDP protocol interface
2025-06-07 04:47:19 +09:00
de41c115cd Update std.js 2025-06-07 04:46:28 +09:00
b168b57de8 Update chrome.js 2025-06-07 04:26:33 +09:00
0de9edc83c Update chrome.js 2025-06-07 04:18:20 +09:00
13839a1fc3 Update chrome.js 2025-06-06 19:40:46 +09:00
9def5b996e Update chrome.js, std.js 2025-06-06 19:35:21 +09:00
5c83c086ac Update chrome.js 2025-06-06 13:01:53 +09:00
1591f46ea5
Merge pull request #267 from gnh1201/dev
Some checks failed
CodeQL / Analyze (javascript) (push) Has been cancelled
Add more Chromium-based browsers
2025-06-06 12:20:11 +09:00
8d8284ecbe Update chrome.js 2025-06-06 12:12:55 +09:00
69c58e0e96
Merge pull request #266 from gnh1201/dev
Some checks failed
CodeQL / Analyze (javascript) (push) Has been cancelled
Fix #251 #246
2025-06-01 22:41:05 +09:00
19d4cdce6c Update chrome.js 2025-06-01 21:39:13 +09:00
821b3748df Update chrome.js 2025-06-01 21:32:46 +09:00
d88132da05 Update chrome.js 2025-06-01 15:17:19 +09:00
f22a11c246 Update chrome.js 2025-06-01 14:48:46 +09:00
f2fe919ed0 Fix #251 #246 2025-06-01 14:44:07 +09:00
9a9805ce6a
Update issue templates
Some checks failed
CodeQL / Analyze (javascript) (push) Has been cancelled
2025-05-30 17:09:11 +09:00
0e8fd4e8e4
Merge pull request #265 from gnh1201/dev
Some checks failed
CodeQL / Analyze (javascript) (push) Has been cancelled
Fix typo of the license and contributing files
2025-05-26 00:41:07 +09:00
1a670b12c7 Update CONTRIBUTING.md 2025-05-26 00:36:21 +09:00
260292a873 Fix typo of the license and contributing files 2025-05-26 00:10:26 +09:00
6278a76df7
Update LICENSE
Some checks are pending
CodeQL / Analyze (javascript) (push) Waiting to run
2025-05-25 19:11:44 +09:00
68aaf07744
Merge pull request #264 from gnh1201/dev
Add LICENSE to each sub-project
2025-05-25 19:10:45 +09:00
a0e29aa491 Add SPDX headers and references to all source files 2025-05-25 15:52:46 +09:00
ec2681b43e Add SPDX and references to all source files 2025-05-25 15:47:19 +09:00
e4e96d566d Add SPDX headers to all source files 2025-05-25 14:56:37 +09:00
bd66105504 Add LICENSE to each project 2025-05-25 13:56:44 +09:00
ceb8c51cf1
Merge pull request #263 from gnh1201/dev
Some checks are pending
CodeQL / Analyze (javascript) (push) Waiting to run
Fix issue with file executable path auto-completion
2025-05-24 16:25:37 +09:00
2b9a406805 Update Completion.cs 2025-05-24 16:23:01 +09:00
cb6e25eaa9 Make traceable tasks 2025-05-24 16:18:43 +09:00
c9b6c6a117 Add the SearchMaxResults const 2025-05-24 16:09:33 +09:00
9b64204771 Fix thread-safety issue with concurrent list access. 2025-05-24 15:51:37 +09:00
d9f9d3e38b Fix issue with file executable path auto-completion 2025-05-24 15:33:07 +09:00
365f0ddbdf
Merge pull request #262 from gnh1201/dev
Merge to main branch #261
2025-05-24 12:56:46 +09:00
7e29cc649f Fix mistypo 2025-05-24 12:53:38 +09:00
bee2be97a9 Add the link text 2025-05-24 12:49:37 +09:00
f1a6ef4435 Fix UI management flow issue. 2025-05-24 12:39:58 +09:00
4deddfd8c9
Merge pull request #261 from gnh1201/bcl-zipfile
Use BCL ZipFile class on Launcher, Add deep inspection for ShadowRoot elements
2025-05-24 12:25:40 +09:00
d214a8d749 Fix issues and PR #254 #260 2025-05-24 12:16:11 +09:00
dcdf79dc3a
Merge pull request #260 from teo-tsirpanis/zip-file
Revert to using the BCL `ZipFile` class, without any NuGet package dependencies.
2025-05-24 11:02:05 +09:00
Theodore Tsirpanis
e74b7b8b73 Remove dependency to System.IO.Compression.ZipFile package. 2025-05-22 03:00:34 +03:00
Theodore Tsirpanis
4d9427f514 Revert "Merge pull request #255 from gnh1201/dev"
This reverts commit 4d37a3eb4a, reversing
changes made to fc31b528da.
2025-05-22 02:54:55 +03:00
Theodore Tsirpanis
ea3e70ab24 Revert "Merge pull request #256 from gnh1201/dev"
This reverts commit 26bc061819, reversing
changes made to 4d37a3eb4a.
2025-05-22 02:54:47 +03:00
Theodore Tsirpanis
f2dc0a3904 Revert "Merge pull request #257 from gnh1201/dev"
This reverts commit 308fccf165, reversing
changes made to 26bc061819.
2025-05-22 02:54:35 +03:00
8eb450c9d9
Fix getDeepElementPosition() couldn't get an element position
Some checks failed
CodeQL / Analyze (javascript) (push) Has been cancelled
2025-05-21 20:41:58 +09:00
a81ccc0efa
Improve getElementPosition() for handling elements within a shadow root
Some checks are pending
CodeQL / Analyze (javascript) (push) Waiting to run
2025-05-21 15:48:19 +09:00
710acc4bbd
Merge pull request #258 from gnh1201/dev
Some checks failed
CodeQL / Analyze (javascript) (push) Has been cancelled
Criminal IP (criminalip.io) integration to WelsonJS Editor
2025-05-17 16:49:11 +09:00
4ece9636cc
Update README.md 2025-05-17 16:48:32 +09:00
6637ebde11 Criminal IP (criminalip.io) integration to WelsonJS Editor 2025-05-17 16:36:49 +09:00
308fccf165
Merge pull request #257 from gnh1201/dev
Some checks are pending
CodeQL / Analyze (javascript) (push) Waiting to run
One more fix #254
2025-05-17 14:24:47 +09:00
b2db6a4b0a One more fix #254 2025-05-17 14:14:15 +09:00
f60754d9d4 One more fix #254 2025-05-17 12:54:07 +09:00
ca9caef94e One more fix #254 2025-05-17 11:50:27 +09:00
c2f578a1c8 Remove the unnecessary line 2025-05-17 11:32:13 +09:00
32a261963a One more fix #254 2025-05-17 11:26:46 +09:00
26bc061819
Merge pull request #256 from gnh1201/dev
Some checks are pending
CodeQL / Analyze (javascript) (push) Waiting to run
One more fix #255
2025-05-17 04:01:37 +09:00
1c678ba7ae Update ZipExtractor.cs 2025-05-17 03:56:45 +09:00
4d37a3eb4a
Merge pull request #255 from gnh1201/dev
Remove the dependency `System.IO.Compression.ZipFile` #254
2025-05-17 03:35:58 +09:00
753ef4c6e5 Fix performance issue when initial start 2025-05-17 03:29:36 +09:00
e454c22053 Adopt the code review 2025-05-17 02:46:48 +09:00
db3f0eae0c
Update WelsonJS.Toolkit/WelsonJS.Launcher/ZipExtractor.cs
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
2025-05-17 02:43:34 +09:00
3361fc1270 Adopt the code review 2025-05-17 02:39:42 +09:00
d9721bdb5a Adopt the code review 2025-05-17 02:32:27 +09:00
edd36c3344 Remove the dependency System.IO.Compression.ZipFile #254
Remove the dependency `System.IO.Compression.ZipFile`

It will be fix the potentially license conflct issue from the `System.IO.Compression.ZipFile` package.
2025-05-17 01:54:51 +09:00
fc31b528da
Merge pull request #253 from gnh1201/dev
Some checks failed
CodeQL / Analyze (javascript) (push) Has been cancelled
Merge pull request #252 from gnh1201/master
2025-05-12 02:31:38 +09:00
718dd77c1b
Merge pull request #252 from gnh1201/master
Update commit history to the dev branch
2025-05-12 02:30:34 +09:00
e1cb460649
Merge pull request #248 from baramofme/master
Fix Gemini llm call
2025-05-12 02:25:56 +09:00
Jihoon Yi
99dc2d321c
Merge branch 'gnh1201:master' into master 2025-05-11 14:28:09 +09:00
0ccddd4e75
Merge pull request #249 from gnh1201/dev
Some checks are pending
CodeQL / Analyze (javascript) (push) Waiting to run
Improve the concept to access a blob sources
2025-05-11 01:30:30 +09:00
5087359ac3 Revert "Replace the keyword void to Task for async method"
This reverts commit 0ad978bb6b.
2025-05-11 01:21:08 +09:00
1ab70d7cd7 Revert "Update CDN servers list"
This reverts commit 0438ee9a50.
2025-05-11 01:05:09 +09:00
0438ee9a50 Update CDN servers list 2025-05-10 21:31:49 +09:00
Jihoon Yi
90ea515f41
Update winservice.js
fix wrong typo
2025-05-10 20:51:17 +09:00
Jihoon Yi
2bff4df4be
Update security.js
fix wrong typo
2025-05-10 20:50:24 +09:00
Jihoon Yi
10606532cb
Update testloader.js
Add missing closing brackets in test_implementsobject
2025-05-10 18:38:45 +09:00
0ad978bb6b Replace the keyword void to Task for async method 2025-05-10 16:53:47 +09:00
Jihoon Yi
452675273b
Update language-inference-engine.js 2025-05-10 16:36:53 +09:00
Jihoon Yi
d8a29eaeee
Update language-inference-engine.js
- Add response type check before parsing
- Wrap JSON.parse in a try/catch to handle potential malformed responses.
- Use “system” role for the initial bias message on gemini model object's wrap
2025-05-10 16:30:46 +09:00
Jihoon Yi
b1078cd36c
Add missing model selection in honoai_gemini.ai.js
Add missing model selection
2025-05-10 16:22:08 +09:00
a001471451 Improve the concept to access a blob sources 2025-05-10 16:07:36 +09:00
Jihoon Yi
bcdfef3f6f
Create honoai_gemini.ai.js
Add honoi ai call with gemini
2025-05-10 15:54:04 +09:00
Jihoon Yi
ef23e41e3a
Update language-inference-engine.js
Fix gemini call broken
2025-05-10 15:50:55 +09:00
5f10d50a3c
Create clean_chrome_pup.bat
Some checks failed
CodeQL / Analyze (javascript) (push) Has been cancelled
2025-05-08 22:31:55 +09:00
aee5fb22d0
Merge pull request #245 from gnh1201/dev
Some checks failed
CodeQL / Analyze (javascript) (push) Has been cancelled
Add JavaScript CDN servers
2025-05-05 23:44:59 +09:00
14c8b12df7 Add a CDN servers 2025-05-05 23:32:41 +09:00
deed89560b Update ResourceServer.cs 2025-05-05 23:22:02 +09:00
eb32437f96 Update ResourceServer.cs 2025-05-05 21:34:50 +09:00
c95b7a373b Update ResourceServer.cs 2025-05-05 21:33:06 +09:00
302e7ce4fc Add an available CDN servers 2025-05-05 19:13:41 +09:00
a5fc5de78f Update ResourceServer.cs 2025-05-05 17:47:50 +09:00
d362d852ad Add JavaScript CDN servers 2025-05-05 17:38:48 +09:00
2a3f9fb4fa
Update README.md
Some checks failed
CodeQL / Analyze (javascript) (push) Has been cancelled
2025-05-01 14:32:48 +09:00
944751121c
Merge pull request #243 from gnh1201/dev
Some checks failed
CodeQL / Analyze (javascript) (push) Has been cancelled
Add the example to use function calling on LLM
2025-04-27 13:14:27 +09:00
fb420d1116 Add the example to use function calling on LLM 2025-04-27 13:09:03 +09:00
26af578178
Merge pull request #242 from gnh1201/dev
Set throttle to the prompt context
2025-04-27 11:43:52 +09:00
245dd85341 Update editor.html 2025-04-27 11:39:43 +09:00
fb6596fe64 Update editor.html 2025-04-27 11:10:00 +09:00
a42180d244 Set throttle to the prompt context 2025-04-27 10:50:52 +09:00
73b24f9a56
Merge pull request #240 from gnh1201/dev
Some checks failed
CodeQL / Analyze (javascript) (push) Has been cancelled
Fix bug when use DevTools CORS policy (WebSocket error)
2025-04-22 21:31:37 +09:00
eae2795bbf Update Program.cs 2025-04-22 21:27:23 +09:00
98e73b2372 Fix bug when use the devtools protocol with the remote allow origins (Fix WebSocket error) 2025-04-22 21:26:42 +09:00
2225ab9011
Merge pull request #239 from gnh1201/dev
Improve WelsonJS Editor with React framework
2025-04-18 19:51:56 +09:00
4c0895850b Update the integrity attributes 2025-04-18 19:48:41 +09:00
ea412908ef Update editor.html 2025-04-18 19:31:23 +09:00
05ea48a0be some updates 2025-04-18 19:22:25 +09:00
243ff95198 Migrate to React framework 2025-04-18 01:06:27 +09:00
8341394912
Merge pull request #238 from gnh1201/dev
Forward Whois and DNS query data to LLM services
2025-04-12 14:34:59 +09:00
e5a89c9182 Forward Whois and DNS query data to LLM services
Forward Whois and DNS query data to LLM services (e.g. Server configuration assistant)
2025-04-12 14:24:59 +09:00
df5b8cd9f0
Merge pull request #237 from gnh1201/dev
Add support the Azure AI, Optimize the HTTPClient object uses.
2025-04-11 14:19:55 +09:00
e7b6a87175 Reduce code complexity 2025-04-11 14:15:03 +09:00
5b2863058a Add support the Azure AI, Optimize the HTTPClient object uses. 2025-04-11 13:44:21 +09:00
cd8844afef
Merge pull request #236 from gnh1201/dev
Update the markdown files
2025-04-10 16:34:47 +09:00
b26d979b8d Update the markdown files 2025-04-10 16:12:43 +09:00
5446a1bee0
Update README.md
Co-authored-by: sourcery-ai[bot] <58596630+sourcery-ai[bot]@users.noreply.github.com>
2025-04-10 15:56:18 +09:00
10101986be
Update README.md
Co-authored-by: sourcery-ai[bot] <58596630+sourcery-ai[bot]@users.noreply.github.com>
2025-04-10 15:56:09 +09:00
47a5f50712
Update README.md
Co-authored-by: sourcery-ai[bot] <58596630+sourcery-ai[bot]@users.noreply.github.com>
2025-04-10 15:56:01 +09:00
86517f313c
Update README.md
Co-authored-by: sourcery-ai[bot] <58596630+sourcery-ai[bot]@users.noreply.github.com>
2025-04-10 15:55:48 +09:00
b6d34404b5 Update README.md 2025-04-10 13:50:37 +09:00
88ac0cd31e Update README.md 2025-04-10 13:41:57 +09:00
3e0fd7c532 Update README.md, SECURITY.MD 2025-04-10 13:39:23 +09:00
22d10cd28b
Merge pull request #235 from gnh1201/dev
Update SECURITY.MD
2025-04-10 13:29:19 +09:00
0e95b72b21 Update SECURITY.MD 2025-04-10 13:23:16 +09:00
426a9d7721
Merge pull request #234 from gnh1201/dev
Update 2025-04-10
2025-04-10 02:29:10 +09:00
d42210f922
Update WelsonJS.Toolkit/WelsonJS.Launcher/Program.cs
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
2025-04-10 02:27:42 +09:00
e853003bda
Merge branch 'master' into dev 2025-04-10 02:26:21 +09:00
8ca4faa88a
Update README.md
Co-authored-by: sourcery-ai[bot] <58596630+sourcery-ai[bot]@users.noreply.github.com>
2025-04-10 02:23:24 +09:00
f84f2195c3 Revert Cache Compression 2025-04-10 02:12:28 +09:00
1742ca385b Update AzureAi.cs 2025-04-10 02:00:18 +09:00
2a9ebaff51 Update AzureAi.cs 2025-04-10 01:48:33 +09:00
916154499c Some updates 2025-04-09 19:58:41 +09:00
53a84b2349 Update README.md 2025-04-07 14:45:25 +09:00
6e3eb5c1d3 Update README.md 2025-04-07 14:44:03 +09:00
4b4754ae16 Update README.md 2025-04-07 14:43:27 +09:00
a273d6aac6 Update README.md 2025-04-07 14:41:56 +09:00
9e1878628b Update README.md 2025-04-07 14:33:47 +09:00
04ce7fdae5 Update README.md, SECURITY.MD 2025-04-07 14:31:11 +09:00
f7de7bd430 Add Cache Compression 2025-04-06 15:23:19 +09:00
ab8a864519
Update README.md 2025-04-05 23:32:10 +09:00
427f8dded0
Update README.md 2025-04-05 23:24:54 +09:00
a96764f725
Update README.md 2025-04-05 23:24:17 +09:00
46d0244c34
Merge pull request #221 from gnh1201/dev
Add the cached blob #220
2025-04-05 20:13:40 +09:00
2cb3c1c331 Add the cached blob 2025-04-05 20:05:23 +09:00
231e6a56bd
Merge pull request #219 from gnh1201/dev
Change the remote blob server to localhost
2025-04-05 17:47:25 +09:00
295ad2fca8 Update ResourceServer.cs 2025-04-05 17:43:34 +09:00
9ecc93a399 Update ResourceServer.cs 2025-04-05 17:42:44 +09:00
2896cc6bf1 Some updates 2025-04-05 17:27:38 +09:00
be37951807 Add the blob server gateway 2025-04-05 17:10:19 +09:00
d38e26ba67
Merge pull request #218 from gnh1201/dev
Refactor an endpoints of the web based editor
2025-04-05 15:24:50 +09:00
dd85e98c9a Some updates 2025-04-05 15:16:15 +09:00
d8fa8779de Refactor an endpoints of the web based editor 2025-04-05 12:53:28 +09:00
f6fd43ae50
Merge pull request #214 from gnh1201/dev
Add Azure AI service (Azure AI Foundry), Add the AppConfig manager
2025-04-02 11:34:00 +09:00
96dbe7b2cd Add Azure AI service (Azure AI Foundry), Add the AppConfig manager 2025-04-02 11:25:23 +09:00
c1fe39d3cc
Merge pull request #213 from gnh1201/dev
Adapt a code review, SRI, CORS, etc.
2025-03-31 17:41:01 +09:00
56ee12741c some updates 2025-03-31 17:09:28 +09:00
4372bdb09d some updates 2025-03-31 16:59:56 +09:00
b21f967a6a Update bootstrap.bat 2025-03-31 16:31:07 +09:00
40b0b704e3 some updates 2025-03-31 15:06:03 +09:00
9a8ee4d7f9 some updates 2025-03-31 14:50:02 +09:00
4f319d474f some updates 2025-03-31 14:18:03 +09:00
93ed60bcf7 some updates 2025-03-31 14:16:35 +09:00
5d717505f4 Edit the codes from code review result 2025-03-30 22:24:35 +09:00
b0e50d33bc Merge branch 'dev' of https://github.com/gnh1201/welsonjs into dev 2025-03-30 21:12:10 +09:00
c0f9816000 Update editor.html 2025-03-30 20:50:54 +09:00
00ea473683 set SRI and CORS policy strictly to editor.html 2025-03-30 20:48:03 +09:00
7e9054fb8f
Merge pull request #203 from gnh1201/dev
Revert "Reduce SAS token period to 2 years"
2025-03-27 18:02:51 +09:00
f29a63027f Revert "Reduce SAS token period to 2 years"
This reverts commit e930cf86fd.
2025-03-27 17:55:13 +09:00
3419e62c6a
Merge pull request #202 from gnh1201/dev
Change the blob download server
2025-03-27 17:50:53 +09:00
e930cf86fd Reduce SAS token period to 2 years 2025-03-27 17:42:58 +09:00
c0a27efd8d Update bootstrap.bat 2025-03-27 17:35:10 +09:00
d42539c0a8
Update README.md 2025-03-26 11:44:37 +09:00
8389f755fd
Merge pull request #200 from gnh1201/dev
Update the assembly info
2025-03-23 16:02:36 +09:00
6d5af6d422 Update the assembly info 2025-03-23 15:55:45 +09:00
7738b3b898
Merge pull request #199 from gnh1201/dev
Add the mutex to avoid redundant
2025-03-23 15:31:28 +09:00
c1052e0147 Code consistency fix, Replace Random to RandomNumberGenerator, Mutex dispose 2025-03-23 15:12:15 +09:00
d3135bef8e Add the mutex to avoid redundant 2025-03-23 14:43:23 +09:00
54af38b6b6 Add TFA (TOTP) endpoint 2025-03-21 23:50:22 +09:00
9d4b7e535c
Merge pull request #198 from gnh1201/dev
Update setup.iss
2025-03-21 19:51:01 +09:00
8190c80f1a Update setup.iss 2025-03-21 19:39:28 +09:00
c887e1914d
Merge pull request #197 from gnh1201/dev
Update in 2025-03-21
2025-03-21 17:25:45 +09:00
394ce1e903 Update in 2025-03-21 2025-03-21 17:18:39 +09:00
d2cba59b6b Update in 2025-03-21
1. Remove PHP asset files. (Moved to github.com/gnh1201/caterpillar)
2. Add `ARM64` architecture support to lib/python3.js and lib/http.js files.
3. Update the installer profile
2025-03-21 12:03:12 +09:00
7a23340623
Merge pull request #196 from gnh1201/dev
Update http.js
2025-03-21 10:47:13 +09:00
5a2a48945b Update http.js 2025-03-21 10:26:54 +09:00
51da417506 Update http.js 2025-03-20 17:03:31 +09:00
a148319b44
Merge pull request #195 from gnh1201/dev
Update setup.iss
2025-03-20 13:24:31 +09:00
340794d14c Update setup.iss 2025-03-20 13:14:01 +09:00
f6b222e469
Merge pull request #194 from gnh1201/dev
Update the installer profile, Dns Query, and namespaces
2025-03-20 11:29:15 +09:00
fb17f37188 Update setup.iss 2025-03-20 11:15:37 +09:00
2450bc0b9c Update ResourceServer.cs 2025-03-20 11:02:33 +09:00
6737b4885b Update DnsQuery.cs 2025-03-20 10:11:29 +09:00
81d6e67f94 Update the namespaces 2025-03-20 09:42:38 +09:00
911be8135c
Merge pull request #193 from gnh1201/dev
Add DNS Query feature
2025-03-19 17:10:42 +09:00
e68c1e5e2f Add DNS Query feature 2025-03-19 17:03:06 +09:00
07e0665275
Merge pull request #192 from gnh1201/dev
Improve initial warming up time, and add WHOIS request feature
2025-03-19 16:02:23 +09:00
4e78905bbc Enhance a performance and security in PR 2025-03-19 15:48:12 +09:00
e2c9169121 Update editor.html, ResourceServer.cs 2025-03-19 14:02:12 +09:00
1f859c75c6 Improve initial start time, and Add WHOIS request 2025-03-19 12:10:00 +09:00
b2fdc38790
Merge pull request #191 from gnh1201/dev
Minor fixes
2025-03-17 17:53:41 +09:00
07991329fc Update editor.html 2025-03-17 17:47:44 +09:00
5cea33ec20
Merge pull request #190 from gnh1201/dev
Minor fixes
2025-03-17 17:40:37 +09:00
01e94830e7 Update editor.html 2025-03-17 17:23:55 +09:00
c8e757487e Update editor.html 2025-03-17 17:19:05 +09:00
9cd4f2d744
Merge pull request #189 from gnh1201/dev
Minor fixes for the context menus
2025-03-17 17:02:32 +09:00
2a2cdf8a4a Update MainForm.cs 2025-03-17 16:49:04 +09:00
4a46d6211c
Merge pull request #188 from gnh1201/dev
One more fixes for #187
2025-03-17 14:01:27 +09:00
98b9019633 Update editor.html 2025-03-17 13:54:38 +09:00
434f5d4a8d Update editor.html 2025-03-17 13:49:23 +09:00
46a3049d62 Update editor.html 2025-03-17 13:29:00 +09:00
be9ed37eea Update editor.html 2025-03-17 13:24:03 +09:00
dd978ab952
Merge pull request #187 from gnh1201/dev
LLM AI based code generation in the code editor
2025-03-17 12:39:46 +09:00
15b2e606b1 Some updates for optimization and security 2025-03-17 11:09:00 +09:00
0cbb22ac26 Add LLM AI code generation 2025-03-16 18:14:02 +09:00
11afb64706
Merge pull request #186 from gnh1201/dev
Update 2025-03-16
2025-03-16 15:50:52 +09:00
240a65e61c Update ResourceServer.cs 2025-03-16 15:37:26 +09:00
2da5051c5b Update ResourceServer.cs 2025-03-16 15:08:20 +09:00
1124dc5bf4 Add a setting to separate web browser user profiles. 2025-03-16 14:28:59 +09:00
b93d16669f Update ExecutablesCollector.cs 2025-03-16 04:33:39 +09:00
5ab1c97b79
Merge pull request #185 from gnh1201/dev
Add the code completion with Monaco Editor #183
2025-03-16 03:44:02 +09:00
0aceb0e86b Update ResourceServer.cs 2025-03-16 03:30:15 +09:00
dc06506276 Add the code completion with Monaco Editor #183
This update supports the ability to auto-completion executable file paths in the code editor through the list of software installed on the local computer.
2025-03-16 03:11:59 +09:00
7947d91c3a
Merge pull request #184 from gnh1201/dev
Add some code for #183 (Auto completion)
2025-03-15 00:55:40 +09:00
1f2a1e79b7 Update ResourceServer.cs 2025-03-15 00:46:07 +09:00
6722704859 Update ResourceServer.cs 2025-03-15 00:37:03 +09:00
96bd29c06a Adopt the comments of the AI reviewers 2025-03-15 00:23:20 +09:00
c6240fb793
Update codeql-analysis.yml 2025-03-15 00:13:02 +09:00
74ca7dcd6c
Update llm-code-review.yml 2025-03-15 00:12:27 +09:00
b1cabe9fbb Add some code for #183 2025-03-15 00:07:28 +09:00
6bb1dcc3f1
Merge pull request #182 from gnh1201/dev
Add the notify (tray) icon to Launcher
2025-03-14 17:59:20 +09:00
b3f75d3c53 Fix status code 2025-03-14 17:55:05 +09:00
4d26f504f8 Merge branch 'dev' of https://github.com/gnh1201/welsonjs into dev 2025-03-14 17:47:15 +09:00
4bc2a95c42 Add the notify (tray) icon to Launcher
Add the notify (tray) icon to Launcher
2025-03-14 17:46:38 +09:00
c382ffbf46
Update README.md
Some checks failed
CodeQL / Analyze (csharp) (push) Has been cancelled
CodeQL / Analyze (javascript) (push) Has been cancelled
CodeQL / Analyze (python) (push) Has been cancelled
2025-03-12 16:12:15 +09:00
6fa4f64e0b
Merge pull request #181 from gnh1201/dev
AI code review workflow test #180
2025-03-12 15:50:25 +09:00
6d601aa79f Update editor.html 2025-03-12 15:47:12 +09:00
4105b567ee Update editor.html 2025-03-12 15:03:43 +09:00
4fbd0970ed
Update llm-code-review.yml
Some checks are pending
CodeQL / Analyze (csharp) (push) Waiting to run
CodeQL / Analyze (javascript) (push) Waiting to run
CodeQL / Analyze (python) (push) Waiting to run
2025-03-11 14:54:29 +09:00
be782c1ebd Update codeql-analysis.yml 2025-03-10 10:43:21 +09:00
1982b0fc6b Update README.md 2025-03-10 10:28:08 +09:00
ff88f484f6
Update llm-code-review.yml
Some checks are pending
CodeQL / Analyze (csharp) (push) Waiting to run
CodeQL / Analyze (javascript) (push) Waiting to run
CodeQL / Analyze (python) (push) Waiting to run
2025-03-10 10:02:03 +09:00
e5c970bea1
Create llm-code-review.yml 2025-03-10 09:59:56 +09:00
653c44dbf6
Merge pull request #179 from gnh1201/dev
Some checks are pending
CodeQL / Analyze (csharp) (push) Waiting to run
CodeQL / Analyze (javascript) (push) Waiting to run
CodeQL / Analyze (python) (push) Waiting to run
Add the favicon.ico response when try a request
2025-03-10 00:33:14 +09:00
9213d18c90 Reduce complexity: Splitting the GetResource method into separate methods 2025-03-10 00:16:42 +09:00
7c19dd366f Add the favicon.ico response when try a request 2025-03-09 23:56:38 +09:00
39c1fbb29b
Update README.md 2025-03-09 18:44:03 +09:00
53124007c2
Update editor.html 2025-03-09 18:01:12 +09:00
fdc6062433
Update editor.html 2025-03-09 17:50:17 +09:00
bb3cd40012
Add the Monaco Editor to WelsonJS Launcher #137
Update editor.html
2025-03-09 17:17:54 +09:00
e9c6a493eb Add the Monaco Editor to WelsonJS Launcher #137
Some checks are pending
CodeQL / Analyze (csharp) (push) Waiting to run
CodeQL / Analyze (javascript) (push) Waiting to run
CodeQL / Analyze (python) (push) Waiting to run
2025-03-08 22:52:45 +09:00
24ba77d1f6
Update README.md
Some checks failed
CodeQL / Analyze (csharp) (push) Has been cancelled
CodeQL / Analyze (javascript) (push) Has been cancelled
CodeQL / Analyze (python) (push) Has been cancelled
2025-03-04 16:52:10 +09:00
a3c26a202d
Update README.md 2025-03-04 16:50:06 +09:00
e9a6e414c1
Update README.md 2025-03-04 16:49:51 +09:00
aa5f3c9b6c Add discord chat link
Some checks failed
CodeQL / Analyze (csharp) (push) Has been cancelled
CodeQL / Analyze (javascript) (push) Has been cancelled
CodeQL / Analyze (python) (push) Has been cancelled
2025-02-28 10:56:47 +09:00
1cf0a8920a Update README.md
Some checks failed
CodeQL / Analyze (csharp) (push) Has been cancelled
CodeQL / Analyze (javascript) (push) Has been cancelled
CodeQL / Analyze (python) (push) Has been cancelled
2025-02-26 22:16:24 +09:00
ba35b022c6 Update README.md 2025-02-26 22:15:29 +09:00
f68c7fd7bd Update README.md 2025-02-26 22:10:11 +09:00
e942f0b9e8 Add the global settings form 2025-02-26 22:01:57 +09:00
ac6cdb0d76
Update README.md
Some checks are pending
CodeQL / Analyze (csharp) (push) Waiting to run
CodeQL / Analyze (javascript) (push) Waiting to run
CodeQL / Analyze (python) (push) Waiting to run
2025-02-26 13:36:44 +09:00
16723acd97
Update README.md 2025-02-26 13:33:58 +09:00
b31a2d43bb
Update README.md 2025-02-26 13:19:57 +09:00
be6f4b027f
Update README.md 2025-02-26 13:14:18 +09:00
1e93dd22ce
Update README.md 2025-02-26 13:03:04 +09:00
64b2eb0f1b
Update README.md 2025-02-26 13:01:33 +09:00
a80c017206
Update README.md 2025-02-26 12:55:38 +09:00
913eb9f9bf
Update README.md 2025-02-26 12:54:35 +09:00
d9175b83a2
Update README.md 2025-02-26 12:53:06 +09:00
f6d112e38f
Update README.md
Some checks are pending
CodeQL / Analyze (csharp) (push) Waiting to run
CodeQL / Analyze (javascript) (push) Waiting to run
CodeQL / Analyze (python) (push) Waiting to run
2025-02-25 15:35:54 +09:00
40129f87e3
Update README.md
Some checks failed
CodeQL / Analyze (csharp) (push) Has been cancelled
CodeQL / Analyze (javascript) (push) Has been cancelled
CodeQL / Analyze (python) (push) Has been cancelled
2025-02-23 17:40:10 +09:00
e375ddf6f5 Add the toolstrip menu "Run as Administrator..." 2025-02-23 15:27:09 +09:00
51110e54b7 allow search an instances in the temporary folder
Some checks are pending
CodeQL / Analyze (csharp) (push) Waiting to run
CodeQL / Analyze (javascript) (push) Waiting to run
CodeQL / Analyze (python) (push) Waiting to run
2025-02-23 03:29:51 +09:00
7d2f76e2dd
Merge pull request #174 from eltociear/patch-1
Some checks failed
CodeQL / Analyze (csharp) (push) Has been cancelled
CodeQL / Analyze (javascript) (push) Has been cancelled
CodeQL / Analyze (python) (push) Has been cancelled
docs: update README.md
2025-02-21 10:30:39 +09:00
Ikko Eltociear Ashimine
5590c81be5
docs: update README.md
minor fix
2025-02-21 03:30:08 +09:00
2c25eb2a43
Update README.md
Some checks are pending
CodeQL / Analyze (csharp) (push) Waiting to run
CodeQL / Analyze (javascript) (push) Waiting to run
CodeQL / Analyze (python) (push) Waiting to run
2025-02-20 21:49:19 +09:00
ece0054da6 Fix the letter case
Some checks are pending
CodeQL / Analyze (csharp) (push) Waiting to run
CodeQL / Analyze (javascript) (push) Waiting to run
CodeQL / Analyze (python) (push) Waiting to run
2025-02-20 14:25:39 +09:00
09e9cccc51 Change the toolkit binary download path 2025-02-20 14:19:54 +09:00
85a315eac7 Remove the detect Windows version because of syntax error 2025-02-20 14:11:22 +09:00
3349255d9a Update the .env file location 2025-02-20 13:54:59 +09:00
c4be361f95 Fix instance data survival time issue
The data in the Temp directory has a short retention period, posing a risk of data loss. Therefore, it has been changed to the AppData directory.
2025-02-20 12:57:53 +09:00
432fd39df2 Update bootstrap.bat
Some checks failed
CodeQL / Analyze (csharp) (push) Has been cancelled
CodeQL / Analyze (javascript) (push) Has been cancelled
CodeQL / Analyze (python) (push) Has been cancelled
2025-02-18 12:53:52 +09:00
b31add8d74 Update language-inference-engine.js
Some checks are pending
CodeQL / Analyze (csharp) (push) Waiting to run
CodeQL / Analyze (javascript) (push) Waiting to run
CodeQL / Analyze (python) (push) Waiting to run
2025-02-15 16:09:39 +09:00
e659c8daf2 Update installService.bat
Some checks failed
CodeQL / Analyze (csharp) (push) Has been cancelled
CodeQL / Analyze (javascript) (push) Has been cancelled
CodeQL / Analyze (python) (push) Has been cancelled
2025-02-11 23:00:27 +09:00
62ab354674 Update installService.bat
Some checks are pending
CodeQL / Analyze (csharp) (push) Waiting to run
CodeQL / Analyze (javascript) (push) Waiting to run
CodeQL / Analyze (python) (push) Waiting to run
2025-02-11 17:17:51 +09:00
8285825c8b Update test.html 2025-02-11 17:00:43 +09:00
e1ebb0ac2a Update test-oss-korea-2023.json 2025-02-11 16:53:26 +09:00
1aa575b13c Revert "Update test-oss-korea-2023.json"
This reverts commit 0f2e874a4a.
2025-02-11 16:50:42 +09:00
0f2e874a4a Update test-oss-korea-2023.json 2025-02-11 16:40:20 +09:00
c9578ae9f1 Update test.html 2025-02-11 16:36:53 +09:00
a4a7391de6 Fix test page error 2025-02-11 16:35:29 +09:00
495944a3b6
Update router.js 2025-02-11 16:25:13 +09:00
477848b77f Update InstancesForm.Designer.cs
Some checks failed
CodeQL / Analyze (csharp) (push) Has been cancelled
CodeQL / Analyze (javascript) (push) Has been cancelled
CodeQL / Analyze (python) (push) Has been cancelled
2025-02-09 22:42:16 +09:00
a3289cc81d Fix some bugs 2025-02-09 22:05:43 +09:00
4fd38e75c3 Add the list of instances
This commit allows restoring and rerunning previously deployed instances.
2025-02-09 21:41:21 +09:00
5a09d7a79a Add support the Content-Type based URI router
Some checks are pending
CodeQL / Analyze (csharp) (push) Waiting to run
CodeQL / Analyze (javascript) (push) Waiting to run
CodeQL / Analyze (python) (push) Waiting to run
Add support the Content-Type based URI router
2025-02-08 21:45:43 +09:00
b912ae0b08 Update apikey.json
Some checks are pending
CodeQL / Analyze (csharp) (push) Waiting to run
CodeQL / Analyze (javascript) (push) Waiting to run
CodeQL / Analyze (python) (push) Waiting to run
2025-02-07 23:47:17 +09:00
eacd68ce88 Update language-inference-engine.js 2025-02-07 23:41:11 +09:00
2251494a48 Update language-inference-engine.js
1. Fix mistypos (e.g.., missing return)
2. Add clovastudio LLM
2025-02-07 23:35:25 +09:00
5b092c7f7a Update README.md
Some checks failed
CodeQL / Analyze (csharp) (push) Has been cancelled
CodeQL / Analyze (javascript) (push) Has been cancelled
CodeQL / Analyze (python) (push) Has been cancelled
2025-02-03 16:42:50 +09:00
4d78bbf31e Update README.md 2025-02-03 16:42:43 +09:00
1c4e607d3d Update README.md 2025-02-03 16:36:03 +09:00
80de6da382 Update README.md 2025-02-03 16:21:51 +09:00
3edff1550c Update README.md 2025-02-03 16:12:21 +09:00
724b89f361 Update README.md 2025-02-03 16:00:03 +09:00
06a09fbc3e
Update language-inference-engine.js
Some checks failed
CodeQL / Analyze (csharp) (push) Has been cancelled
CodeQL / Analyze (javascript) (push) Has been cancelled
CodeQL / Analyze (python) (push) Has been cancelled
2025-01-31 15:55:41 +09:00
2c2696d75f
Update README.md 2025-01-31 13:12:49 +09:00
36d51749b3
Update README.md 2025-01-31 13:10:07 +09:00
ac84bb222d
Update README.md 2025-01-31 13:03:19 +09:00
7c87f25f25
Update README.md 2025-01-31 13:00:20 +09:00
a2123f8765 Update README.md
Some checks are pending
CodeQL / Analyze (csharp) (push) Waiting to run
CodeQL / Analyze (javascript) (push) Waiting to run
CodeQL / Analyze (python) (push) Waiting to run
2025-01-30 23:39:19 +09:00
2078b45566 Update language-inference-engine.js 2025-01-30 23:33:35 +09:00
a7a00a38d8 Update language-inference-engine.js 2025-01-30 23:28:44 +09:00
a5275388e2 Update language-inference-engine.js 2025-01-30 23:28:28 +09:00
b5704d5746 Update language-inference-engine.js 2025-01-30 23:15:58 +09:00
ee038c6c20 Update README.md
Some checks are pending
CodeQL / Analyze (csharp) (push) Waiting to run
CodeQL / Analyze (javascript) (push) Waiting to run
CodeQL / Analyze (python) (push) Waiting to run
2025-01-30 19:54:10 +09:00
827dea443c Update README.md 2025-01-30 19:53:39 +09:00
3cf7f6c07c Update language-inference-engine.js 2025-01-30 19:47:30 +09:00
408e98e46b Update README.md 2025-01-30 19:14:11 +09:00
2878eac81d Update README.md 2025-01-30 19:06:47 +09:00
60a26b3ad0 Update language-inference-engine.js 2025-01-30 18:59:04 +09:00
4c8a127ad3 Update language-inference-engine.js 2025-01-30 17:12:22 +09:00
3f993975eb Merge branch 'master' of https://github.com/gnh1201/welsonjs
Some checks are pending
CodeQL / Analyze (csharp) (push) Waiting to run
CodeQL / Analyze (javascript) (push) Waiting to run
CodeQL / Analyze (python) (push) Waiting to run
2025-01-29 18:41:25 +09:00
68e7e4aec0 Update language-inference-engine.js 2025-01-29 18:24:32 +09:00
e7031baf0b
Update test-oss-korea-2023.json 2025-01-29 18:13:46 +09:00
7d3659ebce Update README.md 2025-01-29 18:07:30 +09:00
a1e254ceb0 Update README.md 2025-01-29 18:06:25 +09:00
0f1c2f3e85 Update README.md 2025-01-29 18:05:35 +09:00
6496da9b7e Update language-inference-engine.js 2025-01-29 17:41:29 +09:00
8699d89694 Update language-inference-engine.js 2025-01-29 17:22:55 +09:00
fb947cc777 Update LIE(Language Inference Engine) integraton of the app.js
Some checks failed
CodeQL / Analyze (csharp) (push) Has been cancelled
CodeQL / Analyze (javascript) (push) Has been cancelled
CodeQL / Analyze (python) (push) Has been cancelled
2025-01-28 09:53:55 +09:00
fe5542a521 Update language-inference-engine.js 2025-01-28 09:46:45 +09:00
47bb893c49 Update language-inference-engine.js 2025-01-28 09:38:23 +09:00
0485412b52 Update apikey.json
Some checks are pending
CodeQL / Analyze (csharp) (push) Waiting to run
CodeQL / Analyze (javascript) (push) Waiting to run
CodeQL / Analyze (python) (push) Waiting to run
2025-01-28 00:19:06 +09:00
ab2f3df4ea Update language-inference-engine.js 2025-01-28 00:02:22 +09:00
df92b4c58e Create language-inference-engine.js 2025-01-27 23:48:34 +09:00
88e6bd27b2 Change the script URLs
Some checks failed
CodeQL / Analyze (csharp) (push) Has been cancelled
CodeQL / Analyze (javascript) (push) Has been cancelled
CodeQL / Analyze (python) (push) Has been cancelled
2025-01-22 14:28:02 +09:00
b640786f62 Create hanoi.ai.js 2025-01-22 13:55:45 +09:00
1c3a367b18
Update README.md
Some checks failed
CodeQL / Analyze (csharp) (push) Has been cancelled
CodeQL / Analyze (javascript) (push) Has been cancelled
CodeQL / Analyze (python) (push) Has been cancelled
2025-01-20 12:05:41 +09:00
8a2a4c4760 Update chatgpt.js 2025-01-20 10:18:10 +09:00
e585b3e2d4 Update app.js 2025-01-20 10:11:04 +09:00
94601cbf4f Update app.js 2025-01-20 10:06:21 +09:00
905b56beb2 Allow load script from ChatGPT (LLM based AI) service 2025-01-20 10:04:49 +09:00
1337320803
Update README.md
Some checks failed
CodeQL / Analyze (csharp) (push) Has been cancelled
CodeQL / Analyze (javascript) (push) Has been cancelled
CodeQL / Analyze (python) (push) Has been cancelled
2025-01-17 16:17:45 +09:00
1e3389acf4
Update README.md 2025-01-17 14:13:44 +09:00
74005364e2 Add Grok (x.ai) interface 2025-01-17 14:04:35 +09:00
1cea720a70
Update README.md
Some checks failed
CodeQL / Analyze (csharp) (push) Has been cancelled
CodeQL / Analyze (javascript) (push) Has been cancelled
CodeQL / Analyze (python) (push) Has been cancelled
2025-01-15 17:57:15 +09:00
eeb0d0bc19
Update README.md 2025-01-15 17:56:47 +09:00
9d47a18325
Update testloader.js 2025-01-15 16:18:06 +09:00
81f196eed2
Update test-misc.json 2025-01-15 16:09:37 +09:00
8adaf4bdb9
Update test-misc.json 2025-01-15 16:09:26 +09:00
daf7db76b6
Update ovftool.js 2025-01-15 15:38:25 +09:00
38b03fe026 Update shell.js, ovftool.js 2025-01-15 15:18:36 +09:00
e2582447cc Update shell.js 2025-01-15 14:56:14 +09:00
6babec9d6b Update shell.js 2025-01-15 14:56:01 +09:00
a5dce5b55d Update shell.js 2025-01-15 14:42:58 +09:00
babfbe4e38 Update .gitignore 2025-01-15 14:00:57 +09:00
c9f03a5e23 Update shell.js, ovftool.js 2025-01-15 13:58:54 +09:00
f9f35da4d4 Create ovftool.js
Some checks failed
CodeQL / Analyze (csharp) (push) Has been cancelled
CodeQL / Analyze (javascript) (push) Has been cancelled
CodeQL / Analyze (python) (push) Has been cancelled
2025-01-13 15:13:25 +09:00
dd3ebc16df Update the credential management 2025-01-13 14:46:48 +09:00
3120a5ea93
Update README.md 2025-01-13 10:59:45 +09:00
8571ec4d00 Update ip-reputation.js
Some checks are pending
CodeQL / Analyze (csharp) (push) Waiting to run
CodeQL / Analyze (javascript) (push) Waiting to run
CodeQL / Analyze (python) (push) Waiting to run
2025-01-10 13:29:05 +09:00
1c6d306760 Create lib/ip-reputation.js 2025-01-10 13:28:46 +09:00
9262d83fd5
Update SECURITY.MD 2025-01-09 16:59:31 +09:00
b682f8fc34
Update bootstrap.bat 2025-01-09 16:03:00 +09:00
e1720c5bcf
Update bootstrap.bat 2025-01-09 14:05:48 +09:00
a78581ee69
Update bootstrap.bat 2025-01-09 14:03:13 +09:00
4eb2d4ae06
Update bootstrap.bat 2025-01-09 13:58:48 +09:00
fdd5c74df5
Update README.md 2025-01-09 11:33:35 +09:00
1857712df4
Update README.md 2025-01-09 11:02:08 +09:00
c5ebf36274
Update README.md 2025-01-09 11:01:43 +09:00
8c2d403502
Update README.md 2025-01-08 17:42:29 +09:00
ec92b9605f
Update README.md 2025-01-06 15:06:19 +09:00
c0e8f92e84
Update README.md 2025-01-01 21:19:01 +09:00
fe4d0d562e Add the server-side script files 2025-01-01 21:12:42 +09:00
58e9bdc4ab Add DEFAULT_JSONRPC2_URL variable to lib/jsonrpc2.js 2025-01-01 19:51:11 +09:00
638b172e77 Fix a proxy services and HTTP request issues
1. Separated the data listing available HTTP proxy services into a separate file. (data/available_proxies.json)
2. Excluded the architecture of the user's PC (e.g., 32-bit, 64-bit) from the User-Agent in HTTP requests.
2025-01-01 19:18:40 +09:00
79295de4ce
Update README.md
Some checks failed
CodeQL / Analyze (csharp) (push) Has been cancelled
CodeQL / Analyze (javascript) (push) Has been cancelled
CodeQL / Analyze (python) (push) Has been cancelled
2024-12-30 13:23:16 +09:00
37aa3ea406
Update README.md 2024-12-30 13:22:08 +09:00
1c9e77f890 Create fix_wsh_js_engine_not_found.reg
Fix: Input Error: There is no script engine for file extension ".js".
해결: 입력 오류: 파일 확장자 ".js"에 해당하는 스크립트 엔진이 없습니다.
2024-12-30 13:17:54 +09:00
da153a7900
Update README.md 2024-12-29 06:27:26 +09:00
7903a38f61
Update aviation.js 2024-12-27 15:04:08 +09:00
a99f1c396f
Update testloader.js 2024-12-27 14:55:46 +09:00
5a5526df63
Update anthropic.js 2024-12-27 14:53:17 +09:00
46c5a91032
Update chatgpt.js 2024-12-27 14:52:17 +09:00
e9ba3cff96
Update apikey.json 2024-12-27 14:49:25 +09:00
b4ace286e3
Create apikey.js 2024-12-27 14:49:01 +09:00
7aeb8edfc2
Update apikey.json 2024-12-27 14:34:57 +09:00
31792ebecd
Update apikey.json 2024-12-27 14:33:41 +09:00
7dcd82e7b9
Create apikey.json 2024-12-27 14:33:21 +09:00
fc4d74b7ac
Update std.js 2024-12-27 14:11:15 +09:00
98ff88ffff
Update browser.js 2024-12-27 14:08:56 +09:00
a3fa1a558e Update task-scheduler.js
Some checks failed
CodeQL / Analyze (csharp) (push) Has been cancelled
CodeQL / Analyze (javascript) (push) Has been cancelled
CodeQL / Analyze (python) (push) Has been cancelled
2024-12-22 03:27:35 +09:00
bf6fa1c044 Create task-scheduler.js 2024-12-22 03:26:41 +09:00
8a185cb048 Add a fast-track consultation channels
Some checks failed
CodeQL / Analyze (csharp) (push) Has been cancelled
CodeQL / Analyze (javascript) (push) Has been cancelled
CodeQL / Analyze (python) (push) Has been cancelled
2024-12-20 17:57:44 +09:00
4d6239b606
Merge pull request #168 from chasca8/master
Some checks failed
CodeQL / Analyze (csharp) (push) Has been cancelled
CodeQL / Analyze (javascript) (push) Has been cancelled
CodeQL / Analyze (python) (push) Has been cancelled
Update test-oss-korea-2023.json
2024-12-20 15:39:46 +09:00
78445aa4dc
Merge branch 'master' into master 2024-12-20 15:36:56 +09:00
4a9f5a7fd8
Update data/test-oss-korea-2023.json
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
2024-12-20 15:20:37 +09:00
e1d2d3e9ff
Update data/test-oss-korea-2023.json
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
2024-12-20 15:20:04 +09:00
7ee1e2b745
Update data/test-oss-korea-2023.json
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
2024-12-20 15:19:39 +09:00
Scarlet
442d081f9d
Update test-oss-korea-2023.json 2024-12-18 21:26:03 +09:00
Scarlet
36da5ec3a1
Update virustotal.js 2024-12-18 19:07:17 +09:00
Scarlet
f49ba40cb9
Update test-oss-korea-2023.json 2024-12-18 18:20:48 +09:00
a886363603
Merge pull request #166 from gnh1201/revert-165-master
Some checks failed
CodeQL / Analyze (csharp) (push) Has been cancelled
CodeQL / Analyze (javascript) (push) Has been cancelled
CodeQL / Analyze (python) (push) Has been cancelled
Revert "Update test-oss-korea-2023.json"
2024-12-18 14:02:57 +09:00
dee6ed1025
Revert "Update test-oss-korea-2023.json" 2024-12-18 14:02:40 +09:00
d8d67ac4c0
Merge pull request #165 from chasca8/master
Update test-oss-korea-2023.json
2024-12-18 13:58:05 +09:00
Scarlet
b400c8d64d
Update test-oss-korea-2023.json 2024-12-17 20:53:53 +09:00
Scarlet
98e2c6c837
Update test-oss-korea-2023.json 2024-12-17 12:03:26 +09:00
a947432134 Update README.md
Some checks failed
CodeQL / Analyze (csharp) (push) Has been cancelled
CodeQL / Analyze (javascript) (push) Has been cancelled
CodeQL / Analyze (python) (push) Has been cancelled
2024-12-12 15:30:22 +09:00
1d0f4172fb Update README.md 2024-12-12 15:28:32 +09:00
06972c2bd1 Update README.md 2024-12-12 15:27:45 +09:00
eccd60c340 Update README.md 2024-12-12 15:26:37 +09:00
c1f9249252 Update aviation.js 2024-12-12 14:36:16 +09:00
c14f4358f3 Add aviation.js, Updatre http.js 2024-12-12 14:22:00 +09:00
2dae3a3abb Update http.js 2024-12-12 13:43:41 +09:00
7d6046624c Update README.md
Some checks are pending
CodeQL / Analyze (csharp) (push) Waiting to run
CodeQL / Analyze (javascript) (push) Waiting to run
CodeQL / Analyze (python) (push) Waiting to run
2024-12-11 14:27:28 +09:00
de4016100a Update AnsiX923Padding.cs, PKCS5Padding.cs
Some checks are pending
CodeQL / Analyze (csharp) (push) Waiting to run
CodeQL / Analyze (javascript) (push) Waiting to run
CodeQL / Analyze (python) (push) Waiting to run
2024-12-10 18:31:31 +09:00
3ed38eec6a Add error handling flags for AnsiX923Padding, and PKCS5Padding 2024-12-10 17:50:10 +09:00
7ef4437447 Add LEA cryptography algorithm 2024-12-10 16:48:48 +09:00
9c662177ec Update ARIA.cs
Some checks are pending
CodeQL / Analyze (csharp) (push) Waiting to run
CodeQL / Analyze (javascript) (push) Waiting to run
CodeQL / Analyze (python) (push) Waiting to run
2024-12-09 17:18:54 +09:00
d6540f1351 Change MD5 to SHA256 in the CreateKey method 2024-12-09 17:17:39 +09:00
1b31859786 Update ARIA.cs 2024-12-09 17:13:58 +09:00
ca857d70eb Update ARIA.cs 2024-12-09 16:55:03 +09:00
eaa52e40a6 Add ARIA cryptography algorithm 2024-12-09 16:50:43 +09:00
5ba8744f6c Update SEED.cs
Some checks failed
CodeQL / Analyze (csharp) (push) Has been cancelled
CodeQL / Analyze (javascript) (push) Has been cancelled
CodeQL / Analyze (python) (push) Has been cancelled
2024-12-06 01:36:31 +09:00
92b3907a8e Clean HIGHT.cs 2024-12-06 00:51:07 +09:00
a95e7e3e0d Update SEED.cs 2024-12-06 00:30:31 +09:00
7a8ef89f09 Update SEED.cs 2024-12-05 18:52:33 +09:00
3b022d68a4 Update SEED.cs 2024-12-05 18:21:21 +09:00
eaa33e3b7b Update SEED.cs 2024-12-05 18:14:24 +09:00
ea78f08710 Update SEED.cs
Some checks are pending
CodeQL / Analyze (csharp) (push) Waiting to run
CodeQL / Analyze (javascript) (push) Waiting to run
CodeQL / Analyze (python) (push) Waiting to run
2024-12-05 17:56:11 +09:00
6fa089a854 Update SEED.cs 2024-12-05 17:45:16 +09:00
ba73fddba5 Update SEED.cs 2024-12-05 17:31:21 +09:00
ff0ab03630 Add the SEED cryptography algorithm (Experimental) 2024-12-05 17:24:06 +09:00
7ba17435ac
Update README.md
Some checks are pending
CodeQL / Analyze (csharp) (push) Waiting to run
CodeQL / Analyze (javascript) (push) Waiting to run
CodeQL / Analyze (python) (push) Waiting to run
2024-12-04 10:25:20 +09:00
5852e987c6
Update README.md 2024-12-03 19:32:32 +09:00
9b4273e370 Update SECURITY.MD 2024-12-02 19:34:19 +09:00
4e6b9ea086 Update SECURITY.MD 2024-12-02 19:33:10 +09:00
caa56cedb8 Update archive.js 2024-11-29 16:54:53 +09:00
701be4c351 Create archive.js 2024-11-29 16:53:31 +09:00
2ba05aa633 Update lib/punycode.js, lib/totp.js 2024-11-28 21:11:17 +09:00
f00e6eed1e
Update totp.js 2024-11-28 14:13:14 +09:00
81592beb64
Update totp.js 2024-11-28 14:10:28 +09:00
ebdc212afb
Update std.js 2024-11-27 19:26:25 +09:00
b880e7a13d
Update std.js 2024-11-27 19:25:01 +09:00
ce10ac7f7b Update std.js 2024-11-27 16:47:59 +09:00
9012a161c3 Update std.js, README.md, SECURITY.md 2024-11-27 16:45:53 +09:00
9038829f24 Remove the Public API URL
The Public API was proposed for the next version (0.2.7.54), but due to the increased security risks of providing an unauthenticated Public API, the Public API URL is being discontinued.

This service will be available in the future through marketplaces offered by cloud platforms. Additionally, as the server-side script is open-source, you can set it up yourself.

https://github.com/gnh1201/caterpillar
2024-11-27 15:36:35 +09:00
116bd84394
Update totp.js
Some checks failed
CodeQL / Analyze (csharp) (push) Has been cancelled
CodeQL / Analyze (javascript) (push) Has been cancelled
CodeQL / Analyze (python) (push) Has been cancelled
2024-11-26 02:46:06 +09:00
69d7d3c632
Update totp.js 2024-11-26 02:03:15 +09:00
400e904aa9 Update totp.js 2024-11-26 01:49:36 +09:00
27f4dc2084 Update totp.js 2024-11-26 01:42:39 +09:00
2ac75fd24e Add TOTP library 2024-11-26 01:41:21 +09:00
8ddff1cf94 Add the security notice to LLM integration libraries
Some checks are pending
CodeQL / Analyze (csharp) (push) Waiting to run
CodeQL / Analyze (javascript) (push) Waiting to run
CodeQL / Analyze (python) (push) Waiting to run
2024-11-25 20:55:47 +09:00
b1428867dc Update the Punycode Public API client 2024-11-25 16:15:14 +09:00
f2044bcfbf Ready use the JSON-RPC 2.0 based stateless proxy
Some checks failed
CodeQL / Analyze (csharp) (push) Has been cancelled
CodeQL / Analyze (javascript) (push) Has been cancelled
CodeQL / Analyze (python) (push) Has been cancelled
2024-11-24 03:15:37 +09:00
b5bc2bd851 Update jsonrpc2.js 2024-11-24 02:20:44 +09:00
b45a7cdd6c Ready use the JSON-RPC 2.0 based stateless proxy 2024-11-23 21:50:32 +09:00
ac31e5e884 Ready use the JSON-RPC 2.0 based stateless proxy 2024-11-23 21:44:03 +09:00
43b5781cbd Ready use the JSON-RPC 2.0 based stateless proxy 2024-11-23 21:26:04 +09:00
3fa72f86d6 Ready use the JSON-RPC 2.0 based stateless proxy 2024-11-23 21:10:06 +09:00
8942a98431 Update http.js 2024-11-23 19:06:43 +09:00
8bb0f68049 Update the search engines 2024-11-23 18:58:29 +09:00
d3743e206c
Update README.md
Some checks failed
CodeQL / Analyze (csharp) (push) Has been cancelled
CodeQL / Analyze (javascript) (push) Has been cancelled
CodeQL / Analyze (python) (push) Has been cancelled
2024-11-20 19:30:27 +09:00
4fe98d32a1
Update README.md 2024-11-20 18:47:20 +09:00
1fc0597f93
Update README.md
Some checks are pending
CodeQL / Analyze (csharp) (push) Waiting to run
CodeQL / Analyze (javascript) (push) Waiting to run
CodeQL / Analyze (python) (push) Waiting to run
2024-11-20 01:17:48 +09:00
0f57fba805 Update std.js
Some checks are pending
CodeQL / Analyze (csharp) (push) Waiting to run
CodeQL / Analyze (javascript) (push) Waiting to run
CodeQL / Analyze (python) (push) Waiting to run
2024-11-19 17:01:56 +09:00
2f74ceb013
Update README.md
Some checks are pending
CodeQL / Analyze (csharp) (push) Waiting to run
CodeQL / Analyze (javascript) (push) Waiting to run
CodeQL / Analyze (python) (push) Waiting to run
2024-11-19 15:31:35 +09:00
009b171946
Update README.md
Some checks are pending
CodeQL / Analyze (csharp) (push) Waiting to run
CodeQL / Analyze (javascript) (push) Waiting to run
CodeQL / Analyze (python) (push) Waiting to run
2024-11-18 20:03:16 +09:00
895bfe1ac8
Update README.md 2024-11-18 19:59:04 +09:00
3033382f64
Update README.md 2024-11-18 16:43:10 +09:00
fd21f2faae
Update README.md 2024-11-18 16:40:58 +09:00
5e1f41b48a Update app.js 2024-11-15 05:27:22 +09:00
b98901c75a Update app.js 2024-11-15 05:24:49 +09:00
9b50e5b078 Rename some files 2024-11-15 04:05:06 +09:00
d9ac6d01d0 Update README.md 2024-11-15 03:51:50 +09:00
57fbb16bd8 Add Advanced Mathematics Test 2024-11-15 03:48:19 +09:00
13a8c94bcf Add library numbers 2024-11-15 02:40:58 +09:00
0d6e2076d6
Rename FUNDING.yml to .github/FUNDING.yml 2024-11-13 16:23:47 +09:00
f6b04faea6
Update README.md 2024-11-13 16:06:55 +09:00
eedac13818
Update README.md 2024-11-13 16:03:38 +09:00
d45c21cf24
Delete lib/archive.js 2024-11-13 13:48:16 +09:00
54a1515bcb
Update README.md 2024-11-11 06:12:38 +09:00
4477ef84bf
Update archive.js 2024-11-08 00:07:06 +09:00
4370f40886
Create archive.js 2024-11-08 00:06:33 +09:00
fe2466b49a Update package.json 2024-11-07 23:39:51 +09:00
a8b54493f7
Update app.js 2024-11-06 16:31:37 +09:00
2ee54f77ae
Update FUNDING.yml 2024-11-06 16:21:25 +09:00
187578861b
Update FUNDING.yml 2024-11-06 16:16:27 +09:00
a0420cd10f
Update FUNDING.yml 2024-11-06 16:12:53 +09:00
2f1a0f6e41 Add support the Groq LLM API 2024-11-06 04:17:56 +09:00
6d0a6c645f Add README.md to WelsonJS.Toolkit 2024-11-05 21:03:41 +09:00
55d34f833d Update .appveyor.yml 2024-11-05 20:45:21 +09:00
a0e9a83ddd Update .appveyor.yml 2024-11-05 20:36:30 +09:00
9a35227728 Update WelsonJS.Toolkit.nuspec 2024-11-05 20:35:09 +09:00
af69d66ea9 Update the nuspec file 2024-11-05 20:33:50 +09:00
2487e56847 Merge branch 'master' of https://github.com/gnh1201/welsonjs 2024-11-05 20:01:50 +09:00
5b264b64fd Change the API name DecryptStringHIGHT to DecryptString and EncryptStringHIGHT to EncryptString 2024-11-05 20:01:34 +09:00
ce7a0034be
Update README.md 2024-11-05 14:29:17 +09:00
a8a13b539c Update ScreenMatch.cs 2024-11-04 03:55:11 +09:00
b2975e053c Update ScreenMatch.cs 2024-11-04 03:24:42 +09:00
41fcb8706f Update README.md 2024-11-04 02:22:15 +09:00
3fc6f19227 Update README.md 2024-11-04 02:18:21 +09:00
3e78e0b5d2 Fix bugs related to the settings and logger 2024-11-04 02:04:02 +09:00
020f99c5b2 Update MainForm.cs 2024-11-04 01:22:33 +09:00
3989eeba45 Add Anthropic API integration 2024-11-04 00:32:25 +09:00
412c72f624 Change the application name to lowercase when used in logging 2024-11-02 04:03:01 +09:00
30c0e20eae fix #154 (Migrate parent.Log() to Microsoft.Extensions.Logging)
Migrate parent.Log() to Microsoft.Extensions.Logging
2024-11-02 03:51:07 +09:00
53bc51a3af Update README.md 2024-10-24 23:20:45 +09:00
f95b769f11 Update README.md 2024-10-23 20:55:31 +09:00
5d8e195635 Update README.md 2024-10-23 20:48:11 +09:00
a60d0649c0 Move the images of README.md to ics.catswords.net 2024-10-23 20:45:40 +09:00
377d2bdd71 Update README.md 2024-10-23 18:15:34 +09:00
64fec9583d Remove unnecessary images 2024-10-23 18:08:19 +09:00
9b6637a697 Update README.md 2024-10-23 18:02:35 +09:00
af096d38b8 Update README.md 2024-10-23 18:01:11 +09:00
7eb960c711 Update README.md 2024-10-23 18:00:37 +09:00
a98c1cbc92 Update README.md 2024-10-23 17:58:47 +09:00
53970f97a1 Update README.md 2024-10-23 17:53:59 +09:00
9193df71b7 Merge branch 'master' of https://github.com/gnh1201/welsonjs 2024-10-23 17:53:22 +09:00
d180a01312 add nuget profile, update README.md 2024-10-23 17:53:12 +09:00
7f13b67f70
Update README.md 2024-10-23 15:32:21 +09:00
c9360c6651
Update README.md 2024-10-23 15:31:53 +09:00
489e10b76e
Update README.md 2024-10-22 18:22:48 +09:00
28be18de01 Update ScreenMatch.cs 2024-10-21 04:49:48 +09:00
c03a8011c2 Update ScreenMatch.cs 2024-10-21 04:16:46 +09:00
06731f4d4b Update ServiceMain.cs 2024-10-21 02:16:11 +09:00
44de5bfd1a
Update testloader.js 2024-10-20 00:07:53 +09:00
a00d43a59e
Update ScreenMatch.cs 2024-10-19 23:28:16 +09:00
9783e55069
Update extramath.js 2024-10-19 23:17:34 +09:00
3b101e177e
Update README.md 2024-10-19 21:04:34 +09:00
08b10b4e4a
Update http.js 2024-10-19 20:49:16 +09:00
65d5ee120b
Update README.md 2024-10-18 22:24:55 +09:00
2fc9b11aa6
Update README.md 2024-10-18 21:41:51 +09:00
feb85625c5 Update ScreenMatch.cs
Some checks failed
CodeQL / Analyze (csharp) (push) Has been cancelled
CodeQL / Analyze (javascript) (push) Has been cancelled
CodeQL / Analyze (python) (push) Has been cancelled
2024-10-15 05:22:07 +09:00
e1d4df74b9 Update defaultService.example.js
Some checks are pending
CodeQL / Analyze (csharp) (push) Waiting to run
CodeQL / Analyze (javascript) (push) Waiting to run
CodeQL / Analyze (python) (push) Waiting to run
2024-10-15 03:00:06 +09:00
6eaeab5c24 Update the dotnet dependencies 2024-10-15 02:26:35 +09:00
b93c6cd48b fix .env support
Some checks are pending
CodeQL / Analyze (csharp) (push) Waiting to run
CodeQL / Analyze (javascript) (push) Waiting to run
CodeQL / Analyze (python) (push) Waiting to run
2024-10-14 04:52:22 +09:00
94afeb406a Add some code to add the .env support
Some checks are pending
CodeQL / Analyze (csharp) (push) Waiting to run
CodeQL / Analyze (javascript) (push) Waiting to run
CodeQL / Analyze (python) (push) Waiting to run
2024-10-14 04:38:18 +09:00
9e623b645f
Update README.md
Some checks failed
CodeQL / Analyze (csharp) (push) Has been cancelled
CodeQL / Analyze (javascript) (push) Has been cancelled
CodeQL / Analyze (python) (push) Has been cancelled
2024-10-12 09:41:44 +09:00
4f92b782e9
Update README.md
Some checks failed
CodeQL / Analyze (csharp) (push) Has been cancelled
CodeQL / Analyze (javascript) (push) Has been cancelled
CodeQL / Analyze (python) (push) Has been cancelled
2024-10-08 16:25:59 +09:00
16427b347f
Update README.md 2024-10-08 15:49:22 +09:00
ea6add25ca
Update http.js 2024-10-08 15:24:24 +09:00
89e3704f33 Apply the color level based quantization 2024-10-08 14:59:04 +09:00
736356fe71 Check if the position of a specific template image has changed using previously extracted sample images.
Some checks failed
CodeQL / Analyze (csharp) (push) Has been cancelled
CodeQL / Analyze (javascript) (push) Has been cancelled
CodeQL / Analyze (python) (push) Has been cancelled
2024-10-07 03:39:28 +09:00
89dc45ac7c
Update SECURITY.MD
Some checks are pending
CodeQL / Analyze (csharp) (push) Waiting to run
CodeQL / Analyze (javascript) (push) Waiting to run
CodeQL / Analyze (python) (push) Waiting to run
2024-10-07 00:01:38 +09:00
c3d4250094
Update README.md 2024-10-06 22:04:22 +09:00
5357ec167a Update the Thanks to links
Some checks are pending
CodeQL / Analyze (csharp) (push) Waiting to run
CodeQL / Analyze (javascript) (push) Waiting to run
CodeQL / Analyze (python) (push) Waiting to run
2024-10-05 19:18:16 +09:00
7824de743f Update screenshot6.png
Some checks are pending
CodeQL / Analyze (csharp) (push) Waiting to run
CodeQL / Analyze (javascript) (push) Waiting to run
CodeQL / Analyze (python) (push) Waiting to run
2024-10-04 20:19:34 +09:00
adce996aae Update MainForm.cs 2024-10-04 17:01:02 +09:00
2e334ec12e
Merge pull request #150 from gnh1201/envform
Some checks failed
CodeQL / Analyze (csharp) (push) Has been cancelled
CodeQL / Analyze (javascript) (push) Has been cancelled
CodeQL / Analyze (python) (push) Has been cancelled
Add the user variables editor and update related files
2024-10-04 15:11:17 +09:00
641c2070a4 Update MainForm.cs, HeartbeatClient.cs 2024-10-04 15:09:05 +09:00
86916d2ed9 Add --user-variables-file parameter when starting a service 2024-10-03 22:56:04 +09:00
c157116680 Use the user variables in the screen matching feature 2024-10-03 22:27:26 +09:00
1a8c93627a Update EnvForm.cs 2024-10-03 21:23:51 +09:00
ee5f503e42 Add import and export feature 2024-10-03 20:58:42 +09:00
c4c7d5480b Update EnvForm.cs 2024-10-03 20:27:41 +09:00
06cb5095b2 Update the env form 2024-10-03 19:48:05 +09:00
f9ddd3b95e Add the env form 2024-10-03 18:09:14 +09:00
740f392c95
Update README.md
Some checks are pending
CodeQL / Analyze (csharp) (push) Waiting to run
CodeQL / Analyze (javascript) (push) Waiting to run
CodeQL / Analyze (python) (push) Waiting to run
2024-10-03 14:40:04 +09:00
be336e6e06 Update the favicon on the launcher app 2024-10-03 14:24:59 +09:00
2318092542 Update README.md 2024-10-03 13:57:09 +09:00
3964f081de Update README.md 2024-10-03 13:56:41 +09:00
ec451f633b Update favicon.ico and related files
New favicon designed by @druidesse
2024-10-03 13:55:26 +09:00
5a7165d142
Update README.md
Some checks are pending
CodeQL / Analyze (csharp) (push) Waiting to run
CodeQL / Analyze (javascript) (push) Waiting to run
CodeQL / Analyze (python) (push) Waiting to run
2024-10-02 14:36:47 +09:00
94183f1e60
Update http.js
Some checks failed
CodeQL / Analyze (csharp) (push) Has been cancelled
CodeQL / Analyze (javascript) (push) Has been cancelled
CodeQL / Analyze (python) (push) Has been cancelled
2024-09-28 16:44:43 +09:00
8300e1dba4
Update http.js 2024-09-28 16:44:27 +09:00
d413cb49b4
Update http.js 2024-09-28 16:36:38 +09:00
7babc6bad7
Update http.js 2024-09-28 16:26:47 +09:00
7e3a6bdf45
Update http.js 2024-09-28 16:24:24 +09:00
bd51f1d8e1
Update http.js 2024-09-28 16:23:39 +09:00
fac76f9328 Update README.md 2024-09-27 21:23:48 +09:00
8285eee3c1 Update testloader.js 2024-09-27 21:00:53 +09:00
a36dd8e257 Update lib/http.js, testloader.js 2024-09-27 20:53:29 +09:00
1e7061efae Update README.md 2024-09-27 16:34:13 +09:00
072110f282 Update README.md 2024-09-27 16:32:13 +09:00
3ecd35c4a6 Update README.md 2024-09-27 16:19:33 +09:00
b71366bac7 Add SearchAPI.io to README.MD 2024-09-27 16:17:15 +09:00
c6f614b106 Update testloader.js 2024-09-27 15:55:31 +09:00
a60e7e5d9e fix #145
* Fix #145
* Change the methods and variables `CharsetDetector` to `DetectCharset`
* Add searchapi.io SERP support
2024-09-27 15:53:19 +09:00
ad6cb7e430 Update README.md 2024-09-27 10:46:39 +09:00
e95275fa35 Update README.md 2024-09-27 10:44:26 +09:00
099e95bfd3 Update README.md 2024-09-27 10:22:09 +09:00
3c57828f3a Update README.md 2024-09-27 10:18:32 +09:00
6a4a94f486 Update README.md 2024-09-27 10:06:35 +09:00
27a0a0f5d7 Update README.md 2024-09-27 10:03:38 +09:00
dac6e7c5b1 Update README.md 2024-09-26 20:56:34 +09:00
80450467fc Update README.md 2024-09-26 20:47:00 +09:00
ff3cbd88dd Fix the Tab UI bug, and fix stdout/stderr clear issue 2024-09-26 19:35:43 +09:00
c411f596f9 Update webloader.js and the screenshot 2024-09-26 18:45:23 +09:00
a0933153ba Change the screenshot and the example log message 2024-09-26 18:35:25 +09:00
f03c0ef913 Change the screenshot and add ui components example page 2024-09-26 18:32:38 +09:00
f3a79a3523 Update README.md 2024-09-26 15:49:14 +09:00
f18cf9b859 Add support Tab UI with golden layout 2024-09-26 15:46:07 +09:00
bf66ef6354 Update README.md 2024-09-26 02:00:48 +09:00
330323f0c2 Update testloader.js 2024-09-26 01:26:06 +09:00
b82f00748a
Update README.md 2024-09-25 23:09:31 +09:00
0f7e74a5e2 Update README.md 2024-09-25 22:36:31 +09:00
4db50b12ca Add the partnerships section to README.md 2024-09-25 22:34:25 +09:00
abe59228be fix and test ok #143 2024-09-25 18:21:55 +09:00
3842d1bea8 Update http.js 2024-09-25 16:12:19 +09:00
4f1154f412 Add support ARM architecture (lib/http.js) 2024-09-25 16:11:41 +09:00
ce440ae7f7 Update websocket.js 2024-09-25 16:00:41 +09:00
124ea0ae30 Merge branch 'master' of https://github.com/gnh1201/welsonjs 2024-09-25 15:53:11 +09:00
4327651e1d Update http.js 2024-09-25 15:52:47 +09:00
f1e45f01bb Change the default binary path (lib/http,js, lib/websocket.js) 2024-09-25 15:52:08 +09:00
5e6e3e30ba
Update certchecker.js 2024-09-25 14:46:53 +09:00
266971f5d3 fix #144 2024-09-25 14:12:19 +09:00
ed3b631b30 Update testloader.js 2024-09-25 12:10:47 +09:00
7389131bdc Update README.md 2024-09-23 23:27:06 +09:00
f9302f50ee Update README.md 2024-09-23 23:19:35 +09:00
13bcbbbb15 Update README.md 2024-09-23 23:16:03 +09:00
27f4b24344 Merge branch 'master' of https://github.com/gnh1201/welsonjs 2024-09-23 22:53:40 +09:00
9a7cc6de38 Add the github octocat logo 2024-09-23 22:40:48 +09:00
15e31d60e6
Update README.md 2024-09-23 22:35:46 +09:00
528a9c93a4 Update README.md 2024-09-23 22:34:21 +09:00
7823a0a9b5 Add signpath logo 2024-09-23 22:32:57 +09:00
193fcb16c2
Update README.md 2024-09-23 22:29:45 +09:00
646c4babaa Update .appveyor.yml 2024-09-23 22:21:15 +09:00
f2e62d6602
Update README.md 2024-09-23 02:27:03 +09:00
8d5f88a488 Update MainForm.cs 2024-09-23 02:06:49 +09:00
c7af90896b Update http.js 2024-09-23 01:47:46 +09:00
b3bb9ba28c
Update http.js 2024-09-22 20:59:51 +09:00
54e7bb77f6
Update http.js 2024-09-22 00:15:01 +09:00
78a65f906e
Update http.js 2024-09-22 00:10:04 +09:00
9f8e930a45
Update http.js 2024-09-21 14:22:57 +09:00
5f91e9be12
Update http.js 2024-09-21 14:18:42 +09:00
e575f41a19
Update http.js 2024-09-21 14:14:43 +09:00
13cb1da59d
Update http.js 2024-09-21 14:12:39 +09:00
05874f90e5
Update http.js 2024-09-21 14:08:29 +09:00
25876bd81f Merge branch 'master' of https://github.com/gnh1201/welsonjs
Some checks failed
CodeQL / Analyze (csharp) (push) Has been cancelled
CodeQL / Analyze (javascript) (push) Has been cancelled
CodeQL / Analyze (python) (push) Has been cancelled
2024-09-20 23:41:33 +09:00
96c57b0daa Add keep_headers parameter #143 2024-09-20 23:41:04 +09:00
af395bf4ac
Update README.md #143 2024-09-20 23:27:27 +09:00
611c70a1ff
Update README.md 2024-09-20 23:26:30 +09:00
9730b639b9 Update the proxy API services #143 2024-09-20 23:21:37 +09:00
de6b70a5b1 Add the proxy API services #143 2024-09-20 23:10:30 +09:00
e7f65d50b0 Update ScreenMatch.cs and related files
Some checks failed
CodeQL / Analyze (csharp) (push) Has been cancelled
CodeQL / Analyze (javascript) (push) Has been cancelled
CodeQL / Analyze (python) (push) Has been cancelled
2024-09-20 16:53:50 +09:00
855cf6adef Update defaultService.example.js, .gitignore 2024-09-20 11:50:29 +09:00
5e82c58873 Update defaultService.example.js
Some checks are pending
CodeQL / Analyze (csharp) (push) Waiting to run
CodeQL / Analyze (javascript) (push) Waiting to run
CodeQL / Analyze (python) (push) Waiting to run
2024-09-20 10:56:28 +09:00
4b63596c3a Update ServiceMain.cs 2024-09-20 10:50:11 +09:00
8734f3f24a Update ScreenMatch.cs, ServiceMain.cs 2024-09-20 10:32:43 +09:00
c0e42480e0 Update ScreenMatch.cs 2024-09-20 09:36:44 +09:00
0742f17f2a Add the Bitmap Comparison with CRC32 hashing
Some checks are pending
CodeQL / Analyze (csharp) (push) Waiting to run
CodeQL / Analyze (javascript) (push) Waiting to run
CodeQL / Analyze (python) (push) Waiting to run
2024-09-19 03:29:43 +09:00
12ce97c385 Update ScreenMatch.cs
Some checks are pending
CodeQL / Analyze (csharp) (push) Waiting to run
CodeQL / Analyze (javascript) (push) Waiting to run
CodeQL / Analyze (python) (push) Waiting to run
2024-09-18 15:51:24 +09:00
c36d7fb71f Update ScreenMatch.cs 2024-09-18 15:01:05 +09:00
27e9a328d4 Save file in the droptop coffee 2024-09-18 14:33:15 +09:00
83efe8a156 Create fsm.js
Some checks are pending
CodeQL / Analyze (csharp) (push) Waiting to run
CodeQL / Analyze (javascript) (push) Waiting to run
CodeQL / Analyze (python) (push) Waiting to run
2024-09-18 03:32:10 +09:00
ec278ade7b Update .gitignore
Some checks are pending
CodeQL / Analyze (csharp) (push) Waiting to run
CodeQL / Analyze (javascript) (push) Waiting to run
CodeQL / Analyze (python) (push) Waiting to run
2024-09-17 23:44:30 +09:00
e38e3fb088 Rename defaultService.js to defaultService.example.js 2024-09-17 23:42:04 +09:00
9cdd9e85ed fix (Happy Chuseok) 2024-09-17 22:22:46 +09:00
775ffb924d
Update SECURITY.MD
Some checks failed
CodeQL / Analyze (csharp) (push) Has been cancelled
CodeQL / Analyze (javascript) (push) Has been cancelled
CodeQL / Analyze (python) (push) Has been cancelled
2024-09-15 23:30:40 +09:00
efd35cd273
Update README.md 2024-09-15 23:29:51 +09:00
4144679db7 Add the event listener onAvScanResult
Some checks are pending
CodeQL / Analyze (csharp) (push) Waiting to run
CodeQL / Analyze (javascript) (push) Waiting to run
CodeQL / Analyze (python) (push) Waiting to run
2024-09-15 02:54:18 +09:00
f7b1461cc5 Add to ClamAV integration to the File Event Monitor
Some checks are pending
CodeQL / Analyze (csharp) (push) Waiting to run
CodeQL / Analyze (javascript) (push) Waiting to run
CodeQL / Analyze (python) (push) Waiting to run
2024-09-14 22:33:58 +09:00
93ea20cf25 Update settings.example.ini 2024-09-14 20:18:10 +09:00
13d7b821be
Update README.md
Some checks failed
CodeQL / Analyze (csharp) (push) Has been cancelled
CodeQL / Analyze (javascript) (push) Has been cancelled
CodeQL / Analyze (python) (push) Has been cancelled
2024-09-10 14:42:11 +09:00
8db76f49ae Update FileEventMonitor.cs
Some checks are pending
CodeQL / Analyze (csharp) (push) Waiting to run
CodeQL / Analyze (javascript) (push) Waiting to run
CodeQL / Analyze (python) (push) Waiting to run
2024-09-09 17:13:07 +09:00
bc74515095 Update FileEventMonitor.cs 2024-09-09 17:10:31 +09:00
672a3637de Add event type: registry modification 2024-09-09 17:09:31 +09:00
91b73186d3 Fix the FileEventMonitor.cs 2024-09-09 16:47:51 +09:00
a18229afea Revert "Update app.js, defaultService.js"
This reverts commit c24166b36d.
2024-09-09 16:42:48 +09:00
c24166b36d Update app.js, defaultService.js 2024-09-09 15:28:33 +09:00
40edee2b83 Remove libyara.NET and a little fixes for sysmon events 2024-09-09 15:26:16 +09:00
671007bb79 Update FileEventMonitor.cs and related files
Some checks are pending
CodeQL / Analyze (csharp) (push) Waiting to run
CodeQL / Analyze (javascript) (push) Waiting to run
CodeQL / Analyze (python) (push) Waiting to run
2024-09-09 12:05:39 +09:00
bdee21a66f Update ScreenMatch.cs
Some checks failed
CodeQL / Analyze (csharp) (push) Has been cancelled
CodeQL / Analyze (javascript) (push) Has been cancelled
CodeQL / Analyze (python) (push) Has been cancelled
2024-09-06 17:04:15 +09:00
6f3153a816 Update ScreenMatch.cs, settings.example.ini 2024-09-06 17:03:11 +09:00
a69603a10c Add options to the screen time 2024-09-06 16:42:15 +09:00
28435522de Update ScreenMatch.cs 2024-09-06 16:10:58 +09:00
da08bb7bb9
Merge pull request #139 from soumt-r/grpc_fix
heartbeat grpc service
2024-09-06 15:35:14 +09:00
Soumt
126169e37c fix: fixed heartbeat grpc service 2024-09-06 00:54:00 +09:00
0eb897b07f
Update chrome.js
Some checks failed
CodeQL / Analyze (csharp) (push) Has been cancelled
CodeQL / Analyze (javascript) (push) Has been cancelled
CodeQL / Analyze (python) (push) Has been cancelled
2024-09-04 20:17:55 +09:00
38288153ed Apply Math.Sqrt(templateWidth * templateHeight) < 10.0
Some checks are pending
CodeQL / Analyze (csharp) (push) Waiting to run
CodeQL / Analyze (javascript) (push) Waiting to run
CodeQL / Analyze (python) (push) Waiting to run
2024-09-04 17:26:31 +09:00
9227518d1e Update ScreenMatch.cs 2024-09-04 16:20:48 +09:00
bab0a3bba2 Fix STAThreadAttribute issue 2024-09-04 16:18:05 +09:00
85ba0c14be Add the sample_clipboard option to the screen time 2024-09-04 14:12:28 +09:00
ca7b7ad3d5 Update ScreenMatch.cs 2024-09-04 13:26:20 +09:00
87d785df45
Update chrome.js
Some checks are pending
CodeQL / Analyze (csharp) (push) Waiting to run
CodeQL / Analyze (javascript) (push) Waiting to run
CodeQL / Analyze (python) (push) Waiting to run
2024-09-04 00:41:01 +09:00
34115728fe
Update chrome.js
Some checks are pending
CodeQL / Analyze (csharp) (push) Waiting to run
CodeQL / Analyze (javascript) (push) Waiting to run
CodeQL / Analyze (python) (push) Waiting to run
2024-09-02 21:41:35 +09:00
7ed1cab718
Update chrome.js 2024-09-02 21:14:05 +09:00
ecf12aa83f
Update chrome.js 2024-09-02 21:13:22 +09:00
ffbb560598
Update chrome.js 2024-09-02 20:51:42 +09:00
eb389d34c7
Update chrome.js 2024-09-02 20:51:28 +09:00
c6d55cd1fa Update settings.example.ini
Some checks are pending
CodeQL / Analyze (csharp) (push) Waiting to run
CodeQL / Analyze (javascript) (push) Waiting to run
CodeQL / Analyze (python) (push) Waiting to run
2024-09-02 16:03:26 +09:00
db557015fd Update ScreenMatch.cs 2024-09-02 16:01:30 +09:00
2f4b95313f Update ScreenMatch.cs 2024-09-02 15:30:20 +09:00
e70c152494 Add heartbeat.proto 2024-09-02 15:18:15 +09:00
9d7f14cddb Add submodule tessdata 2024-09-02 15:15:38 +09:00
dcdaaa11c2 Add tessdata to the assets 2024-09-02 14:58:05 +09:00
3a1d2ab1ba Update ScreenMatch.cs 2024-09-02 14:37:45 +09:00
ba654438ab Add option ocr128 to the screen time feature 2024-09-02 14:17:06 +09:00
4401ba6847 Remove orphan files 2024-09-02 12:48:07 +09:00
0777faaa5b
Update README.md 2024-09-02 12:39:36 +09:00
577b3f018a
Merge pull request #136 from gnh1201/dependabot/nuget/WelsonJS.Toolkit/WelsonJS.Service/RestSharp-112.0.0
Some checks are pending
CodeQL / Analyze (csharp) (push) Waiting to run
CodeQL / Analyze (javascript) (push) Waiting to run
CodeQL / Analyze (python) (push) Waiting to run
Bump RestSharp from 111.4.1 to 112.0.0 in /WelsonJS.Toolkit/WelsonJS.Service
2024-08-30 10:25:10 +09:00
dependabot[bot]
9b5fb5499c
Bump RestSharp in /WelsonJS.Toolkit/WelsonJS.Service
Bumps [RestSharp](https://github.com/restsharp/RestSharp) from 111.4.1 to 112.0.0.
- [Release notes](https://github.com/restsharp/RestSharp/releases)
- [Commits](https://github.com/restsharp/RestSharp/compare/111.4.1...112.0.0)

---
updated-dependencies:
- dependency-name: RestSharp
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-08-29 19:39:58 +00:00
6ab285bc89 Update testloader.js 2024-08-29 19:59:30 +09:00
af30097c6e Add pegjs test 2024-08-29 19:57:53 +09:00
a0e1e34974 Update README.md 2024-08-29 19:13:52 +09:00
09a472b956 Update README.md 2024-08-29 19:13:12 +09:00
1fec9c1f2a Update README.md 2024-08-29 19:12:26 +09:00
1c4b94faaf Add a parser generator (PEG.js) #135 2024-08-29 19:06:19 +09:00
3602cb4a00 refactor #132 2024-08-29 15:34:54 +09:00
e6fd3a800e Update ServiceMain.cs
Some checks failed
CodeQL / Analyze (csharp) (push) Has been cancelled
CodeQL / Analyze (javascript) (push) Has been cancelled
CodeQL / Analyze (python) (push) Has been cancelled
2024-08-29 11:40:23 +09:00
a8ad7746ee Sometimes we have to destroy everything to solve a problem. #132 2024-08-29 11:17:38 +09:00
4aace2a3ae Update settings.example.ini
Some checks failed
CodeQL / Analyze (csharp) (push) Has been cancelled
CodeQL / Analyze (javascript) (push) Has been cancelled
CodeQL / Analyze (python) (push) Has been cancelled
2024-08-27 01:48:32 +09:00
222fe3c1a0 Read the initial configurations from settings.ini 2024-08-27 01:47:55 +09:00
659fb12db1 Fix typos on FileEventMonitor.cs 2024-08-27 01:24:11 +09:00
8593240692 Use HTTP/1.1 on the gRPC client 2024-08-27 01:16:53 +09:00
34e97347f2 Remove non-free, non-microsoft, and no-updates in uriloader.js 2024-08-27 01:03:24 +09:00
7c0adf8f00 Update ScreenMatch.cs 2024-08-26 21:53:13 +09:00
7b7a25f5e9 Update ServiceMain.cs
Some checks are pending
CodeQL / Analyze (csharp) (push) Waiting to run
CodeQL / Analyze (javascript) (push) Waiting to run
CodeQL / Analyze (python) (push) Waiting to run
2024-08-26 18:29:13 +09:00
4e6b63df50 Update ScreenMatch.cs, ServiceMain.cs 2024-08-26 17:53:21 +09:00
0df9166a13 Update the screen time feature 2024-08-26 15:24:38 +09:00
2db49f85f0 Add method ConvertToBinary to the screen time feature
Some checks are pending
CodeQL / Analyze (csharp) (push) Waiting to run
CodeQL / Analyze (javascript) (push) Waiting to run
CodeQL / Analyze (python) (push) Waiting to run
2024-08-26 01:23:02 +09:00
4947151d00 Update FileEventMonitor.cs 2024-08-25 23:22:52 +09:00
44d7d431e3 Revert "Update app.js, defaultService.js"
This reverts commit c208e6dc6c.
2024-08-25 23:21:58 +09:00
72f70d990d Update FileEventMonitor.cs 2024-08-25 23:16:21 +09:00
1f2f940374 Update .gitignore 2024-08-25 23:10:43 +09:00
c208e6dc6c Update app.js, defaultService.js 2024-08-25 23:08:46 +09:00
0eceab3d9b Add option of the interactive service application 2024-08-25 23:04:34 +09:00
f4703ef7a0 Delete 2024-07-29 19 56 13.png 2024-08-25 22:49:26 +09:00
50d1c93f94 Update settings.example.ini 2024-08-25 22:45:25 +09:00
ecfbf7032b Update .gitignore 2024-08-25 22:44:24 +09:00
d9bdd5c578 Update ScreenMatch.cs 2024-08-25 22:43:34 +09:00
277eb08cba Update ScreenMatch.cs
Some checks are pending
CodeQL / Analyze (csharp) (push) Waiting to run
CodeQL / Analyze (javascript) (push) Waiting to run
CodeQL / Analyze (python) (push) Waiting to run
2024-08-25 18:07:31 +09:00
18e81f71ba Use backward search in the screen time 2024-08-25 17:57:22 +09:00
82ac8e5d02 Fix the argument passing convention 2024-08-25 15:28:03 +09:00
e4a8357715 Fix parameter types to pass arguments to scripting engine
Since `ArrayList` is highly compatible with COM, you can use it to pass an array to `ScriptControl`.
2024-08-25 12:56:01 +09:00
3a890168df Update ServiceMain.cs
Some checks are pending
CodeQL / Analyze (csharp) (push) Waiting to run
CodeQL / Analyze (javascript) (push) Waiting to run
CodeQL / Analyze (python) (push) Waiting to run
2024-08-24 22:27:26 +09:00
02681a135e Update the screen time feature 2024-08-24 22:24:26 +09:00
b345d655f1 Change the class names 2024-08-24 21:32:44 +09:00
7f6e21c96e
Update ScreenMatching.cs
Some checks are pending
CodeQL / Analyze (csharp) (push) Waiting to run
CodeQL / Analyze (javascript) (push) Waiting to run
CodeQL / Analyze (python) (push) Waiting to run
2024-08-24 16:18:24 +09:00
32975494f3
Update ScreenMatching.cs 2024-08-24 16:16:07 +09:00
ad06da549f
Update ScreenMatching.cs 2024-08-24 16:13:06 +09:00
ba9088f43f
Update ScreenMatching.cs 2024-08-24 15:57:42 +09:00
016239b014
Update ScreenMatching.cs 2024-08-24 15:40:15 +09:00
66d4926bba Update the screen time feature 2024-08-24 14:57:01 +09:00
7b62e47fd2 Update settings.example.ini 2024-08-24 14:14:01 +09:00
96b91b2298 Update the screen time feature 2024-08-24 13:44:48 +09:00
61ee6aeae0 Add thanks to Hacker News
Some checks failed
CodeQL / Analyze (csharp) (push) Has been cancelled
CodeQL / Analyze (javascript) (push) Has been cancelled
CodeQL / Analyze (python) (push) Has been cancelled
2024-08-23 13:11:32 +09:00
bbefd3331a Update .appveyor.yml 2024-08-23 12:21:37 +09:00
01477b97c5 Update .appveyor.yml 2024-08-23 12:17:35 +09:00
1751f81cce Update .appveyor.yml 2024-08-23 12:06:37 +09:00
cab0211e09 Update .appveyor.yml 2024-08-23 12:00:39 +09:00
2d5b79ceb1 Update .appveyor.yml 2024-08-23 12:00:31 +09:00
6b915a5b4c Update .appveyor.yml 2024-08-23 11:54:35 +09:00
1f0cb81105 Update .appveyor.yml 2024-08-23 11:48:13 +09:00
dbb008772e Update .appveyor.yml 2024-08-23 11:46:03 +09:00
0fa8286d08 Update .appveyor.yml 2024-08-23 11:44:37 +09:00
5146957ea1 Update .appveyor.yml 2024-08-23 11:42:46 +09:00
b183e1925d Update .appveyor.yml 2024-08-23 11:33:17 +09:00
158809732c Update README.md
Some checks are pending
CodeQL / Analyze (csharp) (push) Waiting to run
CodeQL / Analyze (javascript) (push) Waiting to run
CodeQL / Analyze (python) (push) Waiting to run
2024-08-23 08:56:01 +09:00
7633675b33 Update README.md 2024-08-23 08:54:01 +09:00
f8e6340fda Update README.md 2024-08-23 08:46:33 +09:00
4a02689c71 Update README.md 2024-08-23 08:44:42 +09:00
7899efcb9e Update README.md 2024-08-23 08:29:40 +09:00
2c67b77156 Update README.md 2024-08-23 08:28:12 +09:00
dc7b5a9fb2 Update MessageReceiver.cs
Some checks are pending
CodeQL / Analyze (csharp) (push) Waiting to run
CodeQL / Analyze (javascript) (push) Waiting to run
CodeQL / Analyze (python) (push) Waiting to run
2024-08-22 17:00:53 +09:00
97a930ccb3 Update MessageReceiver.cs 2024-08-22 16:59:58 +09:00
6ec6c07ad7 Update MessageReceiver.cs 2024-08-22 16:59:47 +09:00
3c90c76796 Update .appveyor.yml 2024-08-22 11:14:12 +09:00
0b0ca9912d Update .appveyor.yml 2024-08-22 10:39:01 +09:00
fabcdf185a Update .appveyor.yml 2024-08-22 10:34:14 +09:00
ad6eeb46d5 Update .appveyor.yml 2024-08-22 10:32:15 +09:00
6d43cb47a7 Update .appveyor.yml 2024-08-22 10:30:53 +09:00
ca9f0ba456 Update .appveyor.yml 2024-08-22 10:26:11 +09:00
bc0d6646e4 Update MainForm.cs
Some checks are pending
CodeQL / Analyze (csharp) (push) Waiting to run
CodeQL / Analyze (javascript) (push) Waiting to run
CodeQL / Analyze (python) (push) Waiting to run
2024-08-22 09:54:58 +09:00
8c59024b96 Update README.md 2024-08-22 04:16:36 +09:00
ecdc0767b8 Remove DeviceId package (not working) 2024-08-22 04:12:31 +09:00
f61dc98fa6 Update WelsonJS.Toolkit.sln 2024-08-22 04:11:06 +09:00
c985f1fa0a Update WelsonJS.Launcher build configurations 2024-08-22 04:08:37 +09:00
ce88ae603b Update WelsonJS.Launcher 2024-08-22 04:02:31 +09:00
1e82f18bc9 Update MainForm.cs 2024-08-22 03:58:35 +09:00
d8558a4398 Add WelsonJS.Launcher component 2024-08-22 03:36:58 +09:00
7c77daabfa Update .gitignore
Some checks are pending
CodeQL / Analyze (csharp) (push) Waiting to run
CodeQL / Analyze (javascript) (push) Waiting to run
CodeQL / Analyze (python) (push) Waiting to run
2024-08-22 00:55:54 +09:00
81a31c7b1f
Update http.js 2024-08-21 23:38:48 +09:00
f3f2cc482c
Update SECURITY.MD
Some checks are pending
CodeQL / Analyze (csharp) (push) Waiting to run
CodeQL / Analyze (javascript) (push) Waiting to run
CodeQL / Analyze (python) (push) Waiting to run
2024-08-21 08:03:52 +09:00
e8bc5348a8
Update README.md 2024-08-21 08:01:31 +09:00
fe31fd2c97 Update MessageReceiver.cs
Some checks are pending
CodeQL / Analyze (csharp) (push) Waiting to run
CodeQL / Analyze (javascript) (push) Waiting to run
CodeQL / Analyze (python) (push) Waiting to run
2024-08-20 19:37:10 +09:00
f6bbc31551 Update MessageReceiver.cs
Some checks are pending
CodeQL / Analyze (csharp) (push) Waiting to run
CodeQL / Analyze (javascript) (push) Waiting to run
CodeQL / Analyze (python) (push) Waiting to run
2024-08-20 16:31:23 +09:00
8821eb0ae0 fix 2024-08-20 16:03:27 +09:00
c497c0fb26 Update MessageReceiver.cs 2024-08-20 13:44:47 +09:00
ed9e1a6d05 fix 2024-08-20 13:42:44 +09:00
1fa024546a Add flag disabledMessageReceiver 2024-08-20 10:36:59 +09:00
b3548bc35f Update .gitignore 2024-08-20 09:50:30 +09:00
5de04579b7 Update settings.example.ini 2024-08-20 09:49:58 +09:00
80b3e49cb8 Some update configurations 2024-08-20 09:49:03 +09:00
68d100458f Merge branch 'master' of https://github.com/gnh1201/welsonjs 2024-08-20 09:35:27 +09:00
3765d21648
Update SECURITY.MD 2024-08-20 09:34:48 +09:00
e7ed4794e2 Merge branch 'master' of https://github.com/gnh1201/welsonjs 2024-08-20 09:25:56 +09:00
f181bf2696 Update MessageReceiver.cs, app.js #132 2024-08-20 09:25:50 +09:00
1704575cfb
Update SECURITY.MD 2024-08-20 09:11:19 +09:00
905c85a99c
Update SECURITY.MD 2024-08-20 09:06:57 +09:00
c8b3ac5d99 Related works for #132
Some checks are pending
CodeQL / Analyze (csharp) (push) Waiting to run
CodeQL / Analyze (javascript) (push) Waiting to run
CodeQL / Analyze (python) (push) Waiting to run
2024-08-19 17:04:50 +09:00
5d9fb71753 Replace GRPC proto file and delete the related file
Some checks are pending
CodeQL / Analyze (csharp) (push) Waiting to run
CodeQL / Analyze (javascript) (push) Waiting to run
CodeQL / Analyze (python) (push) Waiting to run
2024-08-19 00:35:23 +09:00
1863a76a4c Update build configurations
Some checks failed
CodeQL / Analyze (csharp) (push) Has been cancelled
CodeQL / Analyze (javascript) (push) Has been cancelled
CodeQL / Analyze (python) (push) Has been cancelled
2024-08-15 17:47:29 +09:00
8865723dd4 Update core-js version to 3.38.0
Some checks are pending
CodeQL / Analyze (csharp) (push) Waiting to run
CodeQL / Analyze (javascript) (push) Waiting to run
CodeQL / Analyze (python) (push) Waiting to run
2024-08-14 14:31:32 +09:00
eb05661e2b Update app.js 2024-08-14 14:25:55 +09:00
64e556f37a Update std.js
Some checks are pending
CodeQL / Analyze (csharp) (push) Waiting to run
CodeQL / Analyze (javascript) (push) Waiting to run
CodeQL / Analyze (python) (push) Waiting to run
2024-08-14 14:05:02 +09:00
a20ce41f73 Revert "Update std.js"
This reverts commit 9a583d0284.
2024-08-14 14:04:32 +09:00
9a583d0284 Update std.js 2024-08-14 14:04:17 +09:00
5ec537e142 Update std.js 2024-08-14 14:00:02 +09:00
243db3edaa Revert "Change variable naming convention, Remove dupilicate code (std.js)"
This reverts commit 3aa5a140d1.
2024-08-14 13:50:35 +09:00
3723f775bd Update .appveyor.yml
Some checks are pending
CodeQL / Analyze (csharp) (push) Waiting to run
CodeQL / Analyze (javascript) (push) Waiting to run
CodeQL / Analyze (python) (push) Waiting to run
2024-08-13 18:00:31 +09:00
83ecd79ec0 Update .appveyor.yml 2024-08-13 17:59:50 +09:00
9c77777577 Update .appveyor.yml 2024-08-13 17:59:18 +09:00
832bb12829 Revert "Add the package Costura.Fody"
This reverts commit d6012d88dd.
2024-08-13 17:39:26 +09:00
d6012d88dd Add the package Costura.Fody 2024-08-13 17:21:09 +09:00
d01d28fbf3
Update defaultService.js 2024-08-13 17:05:48 +09:00
f44f0b38b2 Update the files related to settings.ini
Some checks are pending
CodeQL / Analyze (csharp) (push) Waiting to run
CodeQL / Analyze (javascript) (push) Waiting to run
CodeQL / Analyze (python) (push) Waiting to run
2024-08-13 13:39:01 +09:00
d04e03200b some fixes 2024-08-13 11:21:48 +09:00
92bcb33171 Add settings.ini 2024-08-13 11:16:27 +09:00
41e542dc7a
Update FUNDING.yml
Some checks are pending
CodeQL / Analyze (csharp) (push) Waiting to run
CodeQL / Analyze (javascript) (push) Waiting to run
CodeQL / Analyze (python) (push) Waiting to run
2024-08-12 21:17:55 +09:00
c4740f7d61 Add ElasticsearchClient.cs, Update FileEventMonitor.cs 2024-08-12 21:15:03 +09:00
e8c69d1489 Update ScreenMatching.cs 2024-08-12 21:06:02 +09:00
5062d774b7 Some fixes 2024-08-12 21:05:17 +09:00
7de923f90c Remove the elasticsearch client library 2024-08-12 20:19:15 +09:00
7b03d9f020 Update .appveyor.yml 2024-08-12 17:16:16 +09:00
4ff438655d Update WelsonJS.Service.csproj 2024-08-12 17:10:34 +09:00
4ece37fdf4 Update FileEventMonitor 2024-08-12 17:08:32 +09:00
15bd7d40db Update ScreenMatching.cs, ServiceMain.cs 2024-08-12 16:53:31 +09:00
cf34039f5a Update FileEventMonitor.cs 2024-08-12 16:44:25 +09:00
f0a7316eef Some works #131 2024-08-12 16:42:37 +09:00
ee454527af Update FileEventMonitor.cs 2024-08-12 13:36:27 +09:00
5af61c3e76 Update ServiceMain.cs 2024-08-12 13:18:55 +09:00
e8ba073de2 Update FileEventMonitor.cs 2024-08-12 13:15:23 +09:00
0c03995f43 Update .appveyor.yml 2024-08-12 13:13:38 +09:00
5f0df92442 Update .appveyor.yml 2024-08-12 13:12:50 +09:00
1e16ff9483 Update pe.yar
Some checks are pending
CodeQL / Analyze (csharp) (push) Waiting to run
CodeQL / Analyze (javascript) (push) Waiting to run
CodeQL / Analyze (python) (push) Waiting to run
2024-08-12 13:07:16 +09:00
7c8fd0cd45 Update .appveyor.yml 2024-08-12 13:03:52 +09:00
bb2db7b64a Update .appveyor.yml 2024-08-12 13:02:11 +09:00
2631a8f577 some fixes 2024-08-12 13:00:04 +09:00
58d1829c9c Add Yara File Rule Matcher #131 2024-08-12 12:47:19 +09:00
1a4931e283
fix #122
Some checks failed
CodeQL / Analyze (csharp) (push) Has been cancelled
CodeQL / Analyze (javascript) (push) Has been cancelled
CodeQL / Analyze (python) (push) Has been cancelled
2024-08-08 11:07:52 +09:00
b2433e9057 Update .gitignore
Some checks are pending
CodeQL / Analyze (csharp) (push) Waiting to run
CodeQL / Analyze (javascript) (push) Waiting to run
CodeQL / Analyze (python) (push) Waiting to run
2024-08-07 16:31:19 +09:00
1b214a1604 Update bootstrap.bat 2024-08-07 11:58:00 +09:00
b8d2e362bf Update std.js 2024-08-07 11:55:50 +09:00
9f4f240493 Update std.js 2024-08-07 11:55:09 +09:00
3aa5a140d1 Change variable naming convention, Remove dupilicate code (std.js) 2024-08-07 11:52:34 +09:00
00868b708b
Update std.js 2024-08-06 22:03:24 +09:00
eead1f8775
Update std.js 2024-08-06 21:49:10 +09:00
cfadf1e369
Update std.js 2024-08-06 21:37:00 +09:00
fe31aa36bd
Update std.js 2024-08-06 21:34:50 +09:00
d6cf95b345
Update std.js 2024-08-06 21:34:01 +09:00
3ff02c442e
Update std.js 2024-08-06 21:30:31 +09:00
ca6f13196d
Update std.js 2024-08-06 21:15:59 +09:00
69888245bf
Update std.js 2024-08-06 21:00:02 +09:00
4a2fd7943a
Update std.js 2024-08-06 20:59:29 +09:00
3e86686613 Update .appveyor.yml 2024-08-06 20:27:40 +09:00
2bd104fc2f Update .appveyor.yml 2024-08-06 20:23:58 +09:00
334ec48d3e Update .appveyor.yml 2024-08-06 20:14:57 +09:00
ba5d038441 Update .appveyor.yml 2024-08-06 20:13:10 +09:00
93aababfc4 Update .appveyor.yml 2024-08-06 20:12:19 +09:00
daccf5e6de Create .appveyor.yml
Some checks are pending
CodeQL / Analyze (csharp) (push) Waiting to run
CodeQL / Analyze (javascript) (push) Waiting to run
CodeQL / Analyze (python) (push) Waiting to run
2024-08-06 20:08:17 +09:00
a6dbf1bb4b Update WelsonJS.Toolkit.csproj 2024-08-06 19:56:09 +09:00
34a9a843a4 JMT 2024-08-06 19:45:25 +09:00
8e88761547 Delete build_native_libraries.bat 2024-08-06 17:08:27 +09:00
1bb01be01d Remove the checked-in binaries #130 2024-08-06 17:05:51 +09:00
dbae10a4e5
Update har.js
Some checks failed
CodeQL / Analyze (csharp) (push) Has been cancelled
CodeQL / Analyze (javascript) (push) Has been cancelled
CodeQL / Analyze (python) (push) Has been cancelled
2024-08-03 21:56:26 +09:00
256ca14284
Update har.js
Some checks are pending
CodeQL / Analyze (csharp) (push) Waiting to run
CodeQL / Analyze (javascript) (push) Waiting to run
CodeQL / Analyze (python) (push) Waiting to run
2024-08-03 17:49:22 +09:00
ac2e1117a7
Update har.js 2024-08-03 17:10:34 +09:00
1b8fbf78bf
Update har.js 2024-08-03 16:49:30 +09:00
92e611f49a
Update har.js 2024-08-03 16:45:07 +09:00
5ff6680cee
Update har.js 2024-08-03 16:41:36 +09:00
aeef44d3d9
Update har.js 2024-08-03 15:53:30 +09:00
2e8c530ba9
Update har.js 2024-08-03 15:51:47 +09:00
c6cbe96e03
Update and rename hartool.js to har.js 2024-08-03 15:26:52 +09:00
45a1938aea
Create hartool.js 2024-08-03 15:25:41 +09:00
f55b70585a
Update SECURITY.MD 2024-08-03 14:07:30 +09:00
ff943d3fc2
Update SECURITY.MD
Some checks are pending
CodeQL / Analyze (csharp) (push) Waiting to run
CodeQL / Analyze (javascript) (push) Waiting to run
CodeQL / Analyze (python) (push) Waiting to run
2024-08-02 21:15:38 +09:00
a5672a16ff Update ScreenMatching.cs
Some checks failed
CodeQL / Analyze (csharp) (push) Has been cancelled
CodeQL / Analyze (javascript) (push) Has been cancelled
CodeQL / Analyze (python) (push) Has been cancelled
2024-08-02 16:53:33 +09:00
8df6270287 Update the screen time feature on WelsonJS.Service 2024-08-02 16:51:49 +09:00
70bce6eb72 Update .gitignore 2024-08-02 11:12:03 +09:00
75e386d2a7 Update .gitignore 2024-08-02 11:11:27 +09:00
05c06bffd2 Update WelsonJS.Service binaries 2024-08-02 11:09:32 +09:00
a7bc9fa21a Update ServiceMain.cs 2024-08-02 11:07:41 +09:00
8bd2382973 Update ServiceMain.cs 2024-08-02 11:07:04 +09:00
faf3d55d8d
Update README.md
Some checks failed
CodeQL / Analyze (csharp) (push) Has been cancelled
CodeQL / Analyze (javascript) (push) Has been cancelled
CodeQL / Analyze (python) (push) Has been cancelled
2024-07-31 18:17:09 +09:00
59d9d313f8
Update README.md 2024-07-31 18:14:57 +09:00
83e403cc54 Update setup.iss
Some checks are pending
CodeQL / Analyze (csharp) (push) Waiting to run
CodeQL / Analyze (javascript) (push) Waiting to run
CodeQL / Analyze (python) (push) Waiting to run
2024-07-31 16:19:08 +09:00
a80fd75ec3
Update SECURITY.MD 2024-07-31 09:44:30 +09:00
fc1694198b
Update SECURITY.MD 2024-07-31 09:41:12 +09:00
9ae992dc89 bug fix #126
Some checks are pending
CodeQL / Analyze (csharp) (push) Waiting to run
CodeQL / Analyze (javascript) (push) Waiting to run
CodeQL / Analyze (python) (push) Waiting to run
2024-07-31 00:43:42 +09:00
6297f9689d Add startInteractiveService.bat, uninstallService.bat 2024-07-30 18:17:26 +09:00
172a5109e9 Update setup.iss
Some checks are pending
CodeQL / Analyze (csharp) (push) Waiting to run
CodeQL / Analyze (javascript) (push) Waiting to run
CodeQL / Analyze (python) (push) Waiting to run
2024-07-30 15:46:11 +09:00
e881ec98ec Update README.md 2024-07-30 15:43:17 +09:00
6c9f905c2b Update README.md 2024-07-30 15:42:32 +09:00
0105ef9010 Update README.md 2024-07-30 15:41:05 +09:00
fe568f032e Add screenshot no.5 2024-07-30 15:40:17 +09:00
2766b2dcfc Update cover.png 2024-07-30 15:12:38 +09:00
2e37432990 Update README.md 2024-07-30 13:41:50 +09:00
38ad7ab669 Update README.md 2024-07-30 13:39:28 +09:00
27edbe4652 Update README.md 2024-07-30 13:30:10 +09:00
11abc2d1b3 Update README.md 2024-07-30 13:28:56 +09:00
119ad684ed Update README.md 2024-07-30 13:28:29 +09:00
accdf058c6 Update README.md 2024-07-30 13:22:05 +09:00
8d865b572d Change the cover image 2024-07-30 12:53:27 +09:00
3762dac556 Change the cover image 2024-07-30 12:53:06 +09:00
8f35bfb03b Update WelsonJS.Service
Some checks are pending
CodeQL / Analyze (csharp) (push) Waiting to run
CodeQL / Analyze (javascript) (push) Waiting to run
CodeQL / Analyze (python) (push) Waiting to run
2024-07-29 22:42:35 +09:00
3b09a47fb8 Update the Screen Matching feature 2024-07-29 22:28:07 +09:00
b687cf7727 Add Screen Matching feature 2024-07-29 21:43:14 +09:00
d5f55e0f28 Fix issue the cannot find the working directroy
Some checks are pending
CodeQL / Analyze (csharp) (push) Waiting to run
CodeQL / Analyze (javascript) (push) Waiting to run
CodeQL / Analyze (python) (push) Waiting to run
2024-07-29 16:06:04 +09:00
95a7588726 Revert "Some works for #124"
This reverts commit b5af648512.
2024-07-29 15:41:10 +09:00
f72db8bf2e Revert "Some works for #124"
This reverts commit f73b180329.
2024-07-29 15:41:05 +09:00
02d45ede0f Revert "Update defaultService.js"
This reverts commit ffd6cde177.
2024-07-29 15:40:11 +09:00
ffd6cde177 Update defaultService.js 2024-07-29 15:07:53 +09:00
f73b180329 Some works for #124 2024-07-29 15:04:22 +09:00
b5af648512 Some works for #124
Some checks are pending
CodeQL / Analyze (csharp) (push) Waiting to run
CodeQL / Analyze (javascript) (push) Waiting to run
CodeQL / Analyze (python) (push) Waiting to run
2024-07-29 01:35:46 +09:00
66879f229a Update installService.bat
Some checks failed
CodeQL / Analyze (csharp) (push) Has been cancelled
CodeQL / Analyze (javascript) (push) Has been cancelled
CodeQL / Analyze (python) (push) Has been cancelled
2024-07-27 21:38:38 +09:00
dad5c06a1b Add the service install script 2024-07-27 21:30:07 +09:00
0c5abb4658
Merge pull request #125 from gnh1201/dependabot/npm_and_yarn/requirejs-2.3.7
Some checks failed
CodeQL / Analyze (csharp) (push) Has been cancelled
CodeQL / Analyze (javascript) (push) Has been cancelled
CodeQL / Analyze (python) (push) Has been cancelled
Bump requirejs from 2.3.6 to 2.3.7
2024-07-26 17:29:31 +09:00
dependabot[bot]
0c09c5bd3b
Bump requirejs from 2.3.6 to 2.3.7
Bumps [requirejs](https://github.com/jrburke/r.js) from 2.3.6 to 2.3.7.
- [Commits](https://github.com/jrburke/r.js/compare/2.3.6...2.3.7)

---
updated-dependencies:
- dependency-name: requirejs
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-07-26 08:25:56 +00:00
4a33238d7e Change the target framework version to 4.8, and renaming some functions 2024-07-26 17:24:56 +09:00
3b18896564 Fix incorrect version info of WelsonJS.Service
Some checks failed
CodeQL / Analyze (csharp) (push) Has been cancelled
CodeQL / Analyze (javascript) (push) Has been cancelled
CodeQL / Analyze (python) (push) Has been cancelled
2024-07-23 13:28:16 +09:00
84e094fc19 Update WelsonJS.Service binaries 2024-07-23 13:16:25 +09:00
639dfeeb68 Merge branch 'master' of https://github.com/gnh1201/welsonjs 2024-07-23 13:13:38 +09:00
f60f99fc73 Update WelsonJS.Service and related files 2024-07-23 13:13:33 +09:00
95572825c3
Update README.md
Some checks are pending
CodeQL / Analyze (csharp) (push) Waiting to run
CodeQL / Analyze (javascript) (push) Waiting to run
CodeQL / Analyze (python) (push) Waiting to run
2024-07-23 12:41:57 +09:00
7ef118955d Update WelsonJS.Toolkit binaries 2024-07-23 05:29:46 +09:00
c3114ab3f9 Add Microsoft Teams links to WelsonJS.Toolkit 2024-07-23 05:24:39 +09:00
e25baeae9c Delete sfx_config.txt 2024-07-23 05:09:56 +09:00
4afc6deab8 Create sfx_config.txt
Some checks are pending
CodeQL / Analyze (csharp) (push) Waiting to run
CodeQL / Analyze (javascript) (push) Waiting to run
CodeQL / Analyze (python) (push) Waiting to run
2024-07-23 04:29:50 +09:00
d15f23a3c1 Update app.js and clean up files 2024-07-23 04:26:38 +09:00
aa4ca1b212 Update WelsonJS.Service binaries 2024-07-23 01:17:31 +09:00
d0fe3d6acb Update ServiceMain.Designer.cs 2024-07-23 01:14:59 +09:00
be16fbfd72 Add screenshot 4 2024-07-23 01:07:21 +09:00
8c247adede Update WelsonJS.Service binaries and example 2024-07-23 00:37:12 +09:00
def32aa559 Update ServiceMain.cs 2024-07-23 00:23:01 +09:00
1e9533a9a5 Update app.js 2024-07-23 00:22:01 +09:00
debc806516 Update ServiceMain.cs 2024-07-23 00:20:20 +09:00
91631c6c1d Update ServiceMain.cs 2024-07-22 21:02:07 +09:00
360d37cd36 Update ServiceMain.cs
Some checks are pending
CodeQL / Analyze (csharp) (push) Waiting to run
CodeQL / Analyze (javascript) (push) Waiting to run
CodeQL / Analyze (python) (push) Waiting to run
2024-07-22 20:36:34 +09:00
d758957d68 Update ServiceMain.cs 2024-07-22 20:21:54 +09:00
7456bf903e Update WelsonJS.Service component 2024-07-22 20:15:31 +09:00
239b039e2a Update WelsonJS.Service component 2024-07-22 18:47:08 +09:00
7c6c633362 Update app.js 2024-07-22 16:12:45 +09:00
575e0cf6fc Add WelsonJS.Service component 2024-07-22 16:04:40 +09:00
31fb594904
Update app.js
Some checks are pending
CodeQL / Analyze (csharp) (push) Waiting to run
CodeQL / Analyze (javascript) (push) Waiting to run
CodeQL / Analyze (python) (push) Waiting to run
2024-07-22 00:56:55 +09:00
a592cd08cf
Update app.js 2024-07-22 00:09:57 +09:00
ebb254061d
Update app.js 2024-07-22 00:08:00 +09:00
f2239e75a9
Update http.js
Some checks are pending
CodeQL / Analyze (csharp) (push) Waiting to run
CodeQL / Analyze (javascript) (push) Waiting to run
CodeQL / Analyze (python) (push) Waiting to run
2024-07-21 19:55:42 +09:00
0764d2793d
Update app.js 2024-07-21 19:38:25 +09:00
4db58b0a3a
Update app.js 2024-07-21 19:23:38 +09:00
ca2976f314
Update app.js 2024-07-21 19:04:39 +09:00
688d4963a5
Update app.js 2024-07-21 19:03:52 +09:00
84dc76800b
Update app.js 2024-07-21 19:00:09 +09:00
190a5c81e3
Update app.js 2024-07-21 18:57:57 +09:00
b096dbe7c6
Update app.js 2024-07-21 18:37:54 +09:00
8b5abfe022
Update http.js fix #122
Some checks are pending
CodeQL / Analyze (csharp) (push) Waiting to run
CodeQL / Analyze (javascript) (push) Waiting to run
CodeQL / Analyze (python) (push) Waiting to run
2024-07-20 17:19:50 +09:00
4db44324e4
Update README.MD 2024-07-20 16:38:02 +09:00
1d21145d95
Update README.MD 2024-07-20 16:37:25 +09:00
ac7169cfe3
Update README.MD 2024-07-20 16:36:42 +09:00
ca3baeebdd
Update README.MD 2024-07-20 16:36:16 +09:00
b92f68e697
Update README.MD 2024-07-20 16:35:41 +09:00
a6b77826d5
Update README.MD 2024-07-20 16:35:22 +09:00
ce591bd9a7
Update README.MD 2024-07-20 16:34:50 +09:00
d71ce372a3
Update README.MD 2024-07-20 16:33:52 +09:00
89a2cd3684
Update SECURITY.MD 2024-07-20 15:04:57 +09:00
f6f4bd673d
Update machine-uuid-mysql.js
Some checks failed
CodeQL / Analyze (csharp) (push) Has been cancelled
CodeQL / Analyze (javascript) (push) Has been cancelled
CodeQL / Analyze (python) (push) Has been cancelled
2024-07-15 00:37:24 +09:00
2064d40bc9
Update machine-uuid-mysql.js 2024-07-15 00:36:44 +09:00
ace15e3248
Create machine-uuid-mysql.js 2024-07-15 00:35:00 +09:00
a586b7c23f
Update README.md
Some checks are pending
CodeQL / Analyze (csharp) (push) Waiting to run
CodeQL / Analyze (javascript) (push) Waiting to run
CodeQL / Analyze (python) (push) Waiting to run
2024-07-13 16:20:08 +09:00
8cdcff4660
Update README.md
Some checks are pending
CodeQL / Analyze (csharp) (push) Waiting to run
CodeQL / Analyze (javascript) (push) Waiting to run
CodeQL / Analyze (python) (push) Waiting to run
2024-07-12 16:26:13 +09:00
a56d8eb11b
Update setup.iss
Some checks failed
CodeQL / Analyze (csharp) (push) Has been cancelled
CodeQL / Analyze (javascript) (push) Has been cancelled
CodeQL / Analyze (python) (push) Has been cancelled
2024-07-10 20:47:08 +09:00
0a35ade427
Update wmi.js 2024-07-10 20:42:46 +09:00
7a98e9c8bf
Merge pull request #120 from gnh1201/shell-prefix
Add `.setPrefix()` method to `lib/shell` and related files, and supports BITS / 명령행 접두어 및 BITS 지원
2024-07-10 20:06:59 +09:00
aa489da1dc fix 2024-07-10 20:05:45 +09:00
c49d2720f2 fix 2024-07-10 19:54:18 +09:00
0f8557b09f Update autoit.js 2024-07-10 19:47:24 +09:00
c9bc48ad88 fix 2024-07-10 19:46:30 +09:00
4c68780e87 Update shell.js 2024-07-10 19:39:45 +09:00
b3a4125253 Update http.js 2024-07-10 19:37:39 +09:00
1309e2ab8f fix 2024-07-10 19:26:58 +09:00
97f68c39bb
Create .sonarcloud.properties 2024-07-10 15:20:48 +09:00
3c375f6a7c
Update http.js 2024-07-10 13:03:59 +09:00
92c9ae3063
Update http.js 2024-07-10 12:59:28 +09:00
be6937156f
Update http.js 2024-07-10 12:56:18 +09:00
92fdc2ff57
Update http.js 2024-07-10 12:51:16 +09:00
98b49b80a1
Update http.js 2024-07-10 12:07:52 +09:00
840e3bfb4c
Update http.js 2024-07-10 12:05:47 +09:00
4716a3a39e
Update shell.js 2024-07-10 12:03:22 +09:00
f4b2a68121
Update shell.js 2024-07-10 12:01:05 +09:00
c773406464
Update shell.js 2024-07-10 12:00:55 +09:00
25536a9b07
Update powershell.js 2024-07-10 11:57:24 +09:00
870ad0e52e
Update powershell.js 2024-07-10 11:56:53 +09:00
dbe48f9624
Update http.js 2024-07-10 11:48:28 +09:00
fd18d9d150
Update adb.js 2024-07-10 11:37:58 +09:00
83bc9a4b58
Update shell.js
Some checks are pending
CodeQL / Analyze (csharp) (push) Waiting to run
CodeQL / Analyze (javascript) (push) Waiting to run
CodeQL / Analyze (python) (push) Waiting to run
2024-07-10 11:32:02 +09:00
4b02143a44
Update http.js 2024-07-10 11:31:27 +09:00
9dda6f1e09
Update shell.js 2024-07-10 11:27:02 +09:00
3e67209ae8
Merge pull request #118 from gnh1201/catproxy-nmap
Some checks failed
CodeQL / Analyze (csharp) (push) Has been cancelled
CodeQL / Analyze (javascript) (push) Has been cancelled
CodeQL / Analyze (python) (push) Has been cancelled
NMAP support with Caterpillar Proxy
2024-07-04 15:25:40 +09:00
6cf7d3e223
Merge branch 'master' into catproxy-nmap 2024-07-04 15:24:52 +09:00
7453b1f1ad
Update catproxy.js 2024-07-04 14:58:29 +09:00
8a935345c5
Update catproxy.js 2024-07-04 14:58:14 +09:00
2e9143c220
Update nmap.js 2024-07-04 14:57:20 +09:00
5ba7476685
Update catproxy.js 2024-07-04 14:52:48 +09:00
cde58c21a4
Update catproxy.js 2024-07-04 14:30:12 +09:00
145e22de21
Update http.js
Some checks are pending
CodeQL / Analyze (csharp) (push) Waiting to run
CodeQL / Analyze (javascript) (push) Waiting to run
CodeQL / Analyze (python) (push) Waiting to run
2024-07-04 10:56:48 +09:00
a20e0004d2
Update testloader.js
Some checks failed
CodeQL / Analyze (csharp) (push) Has been cancelled
CodeQL / Analyze (javascript) (push) Has been cancelled
CodeQL / Analyze (python) (push) Has been cancelled
2024-07-01 01:46:54 +09:00
c0e2b7731a
Update catproxy.js 2024-07-01 01:29:24 +09:00
2f974727d6
Update jsonrpc2.js 2024-07-01 01:27:51 +09:00
c91e01e13d
Update and rename caterpillar.js to catproxy.js 2024-07-01 00:53:58 +09:00
137793cd77
Update caterpillar.js
Some checks failed
CodeQL / Analyze (csharp) (push) Has been cancelled
CodeQL / Analyze (javascript) (push) Has been cancelled
CodeQL / Analyze (python) (push) Has been cancelled
2024-06-26 17:18:36 +09:00
27636a4a72
Update jsonrpc2.js 2024-06-26 17:17:15 +09:00
d86c9728e3
Update caterpillar.js 2024-06-26 17:16:35 +09:00
7de4e4f1be
Create caterpillar.js 2024-06-26 17:07:52 +09:00
3733eaea45
Update jsonrpc2.js 2024-06-26 16:37:04 +09:00
c9c70d9be6
Update README.md
Some checks failed
CodeQL / Analyze (csharp) (push) Has been cancelled
CodeQL / Analyze (javascript) (push) Has been cancelled
CodeQL / Analyze (python) (push) Has been cancelled
2024-06-21 14:31:11 +09:00
54d421fb4f Update pipe-ipc.js
Some checks failed
CodeQL / Analyze (csharp) (push) Has been cancelled
CodeQL / Analyze (javascript) (push) Has been cancelled
CodeQL / Analyze (python) (push) Has been cancelled
2024-06-10 07:14:37 +09:00
14e87fbe63 Update lib/pipe-ipc, lib/xml 2024-06-10 07:13:45 +09:00
46eb8e6609 Clean up code 2024-06-10 06:23:35 +09:00
aa8f10b6a7 Update msoffice.js 2024-06-02 02:14:23 +09:00
b391867f14 fix mistypos 2024-06-02 02:04:46 +09:00
5f5386765d Add and fix the test files 2024-06-02 02:00:17 +09:00
b193fadd72 Update lib/msoffice, Create lib/filetypes.js and data 2024-06-01 06:58:11 +09:00
b6bff48cd0
Update README.md 2024-05-30 12:49:42 +09:00
1fd9adc8be
Update CITATION.cff 2024-05-30 12:08:59 +09:00
b74d64b7ad
Create CITATION.cff 2024-05-29 18:29:28 +09:00
02764be097
Add DOI 2024-05-29 17:22:24 +09:00
6af7be9572 Merge branch 'master' of https://github.com/gnh1201/welsonjs 2024-05-28 16:13:00 +09:00
ed182b42f9 Update screenshot3.png 2024-05-28 16:12:56 +09:00
87d2a41193
Update CONTRIBUTING.md 2024-05-27 17:59:55 +09:00
ff7322a5de
Add files via upload 2024-05-27 17:51:23 +09:00
66d2f0fb7e
Add files via upload 2024-05-27 17:49:50 +09:00
062d00098e
Update http.js 2024-05-22 18:36:01 +09:00
a96052ce27
Update http.js 2024-05-22 18:34:45 +09:00
0f07c61ad6
Update http.js 2024-05-22 18:30:07 +09:00
2157a23d9f
Update README.md 2024-05-22 13:44:38 +09:00
3286121461 Update setup.iss 2024-05-13 17:52:15 +09:00
6361cb333e Update setup.iss 2024-05-13 17:44:16 +09:00
30ab79eae3 Edit installer files 2024-05-13 17:37:54 +09:00
c9c6481b3f Update AssemblyInfo.cs 2024-05-13 17:09:24 +09:00
e3e68bf696 Add BitmapUtils.cs, Toolkit.cs and more 2024-05-13 17:05:24 +09:00
2edda2b710 Update BitmapUtils.cs 2024-05-13 16:54:17 +09:00
24dcfdb2cc Add BitmapUtils.cs and more 2024-05-13 16:53:33 +09:00
2408e89940
Update chrome.js 2024-04-24 03:42:47 +09:00
547da8ab60
Update chrome.js 2024-04-24 03:41:38 +09:00
c1cc02c217
Update chrome.js 2024-04-24 03:33:12 +09:00
0b4cacf417
Update chrome.js 2024-04-24 03:28:57 +09:00
9bab66ab53 Add VoC link 2024-04-07 20:28:21 +09:00
02073e2247 Update README.md 2024-04-07 16:02:06 +09:00
4aff088de0 Update README.md 2024-04-07 16:01:10 +09:00
475739e9e9 Update README.md 2024-04-07 15:58:21 +09:00
a5f36ea692 Update jsonrpc2.js 2024-04-07 15:55:16 +09:00
6537f9a635 Update jsonrpc2.js 2024-04-07 15:53:55 +09:00
e332682fd2 Add JSON-RPC 2.0 support 2024-04-07 15:48:40 +09:00
9f24bf6384 Update lib/adb.js and delete unnecessary files 2024-04-07 15:30:30 +09:00
b7ac95d8ea Fix #111 2024-04-06 20:46:41 +09:00
14145d6f70 fix indentation 2024-04-06 20:26:58 +09:00
db5c294ab9 Fix the feedback 2024-04-05 #109 2024-04-06 20:26:07 +09:00
6591ee7074 Add linq.js 4.0.2 2024-04-06 15:17:59 +09:00
3f07d2355d Update README.md 2024-04-02 13:58:09 +09:00
b1a7a63987
Merge pull request #108 from fossabot/add-license-scan-badge
Add license scan report and status
2024-04-02 13:50:30 +09:00
7e75b5a812 Add FOSSA report link 2024-04-02 13:39:27 +09:00
d8a8b7e27c remove fossa_report 2024-04-02 11:41:51 +09:00
2d67c88fc8 Add fossa_report 2024-04-01 18:29:00 +09:00
87a16c69b6
Update package.json 2024-04-01 18:14:11 +09:00
fossabot
937d540db5 Add license scan report and status
Signed off by: fossabot <badges@fossa.com>
2024-04-01 06:05:12 -03:00
61de14a449 Update README.md 2024-03-21 02:09:23 +09:00
7f37d5e396 Update README.md 2024-03-21 02:05:12 +09:00
c7869d6819 Update README.md 2024-03-21 01:53:18 +09:00
ab6b28f220 Update README.md 2024-03-21 01:44:47 +09:00
7cc1dfd06a Update README.md 2024-03-21 01:37:38 +09:00
d4191917f6 Update README.md 2024-03-21 01:05:15 +09:00
c41bc5b791 Update README.md 2024-03-21 01:25:08 +09:00
853eabc898 Update README.md 2024-03-21 01:23:45 +09:00
8aa0005427 Update README.md 2024-03-21 01:22:09 +09:00
0b9c5f0c5e Fix summernote issues 2024-03-20 21:12:59 +09:00
0e324a349d Fix summernote issues 2024-03-20 16:30:30 +09:00
f7b4934f6b Update README.md 2024-03-20 11:22:37 +09:00
533521239f Add method Browser.waitUntil 2024-03-20 11:13:58 +09:00
05df3518ac Update encryptor.js 2024-03-19 18:00:08 +09:00
e0df993bad Update encryptor.js 2024-03-19 17:59:34 +09:00
4c88348ddf Update README.md 2024-03-19 17:48:40 +09:00
1308d7a115 Update README.md 2024-03-19 17:45:23 +09:00
aca13b53eb Update README.md 2024-03-19 17:44:39 +09:00
f105bb2eb7 Update README.md 2024-03-19 17:39:22 +09:00
40972575b6 Update README.md 2024-03-19 17:25:42 +09:00
98fe04291b Update README.md 2024-03-19 17:24:00 +09:00
ddb9a47f59 Update README.md 2024-03-19 17:23:01 +09:00
36c5a8a586 fix description 2024-03-19 17:21:51 +09:00
c8b5e82b12 Fix descriptions 2024-03-19 17:17:15 +09:00
2fb4b62b8d Update testloader.js, test-misc.json 2024-03-12 15:07:12 +09:00
51ef1508bd
Update FUNDING.yml 2024-02-23 17:10:22 +09:00
85fd0e2e01 Update encryptor.js 2024-01-30 18:28:54 +09:00
94f11d73cd Update app.js 2024-01-27 14:12:40 +09:00
302b33d48b Update sendmail.js 2024-01-27 14:01:57 +09:00
9cdfd205bf Remove the package: html5media 2024-01-27 13:51:32 +09:00
64d178a53a
Update README.MD 2024-01-27 10:02:42 +09:00
a5ba2423d5
Update README.MD 2024-01-27 10:02:19 +09:00
bbd45ab9f9
Update README.MD 2024-01-27 01:17:12 +09:00
ef755b3217
Update README.MD 2024-01-27 01:16:49 +09:00
824 changed files with 133770 additions and 12697 deletions

50
.appveyor.yml Normal file
View File

@ -0,0 +1,50 @@
version: 0.2.7.build{build}
image: Visual Studio 2019
clone_folder: C:\projects\welsonjs
environment:
ORGANIZATION_ID: 8ee5ec82-36dc-4619-ac33-5bc1117428fe
PROJECT_SLUG: welsonjs
ARTIFACT_CONFIGURATION_SLUG: initial
matrix:
- CONFIGURATION: Debug
SIGNING_POLICY_SLUG: test-signing
- CONFIGURATION: Release
SIGNING_POLICY_SLUG: release-signing
before_build:
- nuget restore WelsonJS.Toolkit
build_script:
- msbuild "C:\projects\welsonjs\WelsonJS.Toolkit\WelsonJS.Toolkit.sln" /verbosity:minimal /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll" /p:Configuration=%CONFIGURATION% /p:Platform="x86"
after_build:
- cmd: mkdir artifacts
#- cmd: xcopy /s /y WelsonJS.Toolkit\WelsonJS.Toolkit\bin\x86\%CONFIGURATION%\* artifacts\
- cmd: xcopy /s /y WelsonJS.Toolkit\WelsonJS.Service\bin\x86\%CONFIGURATION%\* artifacts\
- cmd: xcopy /s /y WelsonJS.Toolkit\WelsonJS.Launcher\bin\x86\%CONFIGURATION%\* artifacts\
- cmd: xcopy /s /y WelsonJS.Toolkit\Catswords.Phantomizer\bin\%CONFIGURATION%\netstandard2.0\* artifacts\
- cmd: nuget pack WelsonJS.Toolkit\WelsonJS.Toolkit\ -properties Configuration=%CONFIGURATION% -properties Platform=x86 -OutputDirectory artifacts\
- ps: Start-BitsTransfer -Source "https://catswords.blob.core.windows.net/welsonjs/welsonjs_setup_unsigned.exe" -Destination "artifacts\welsonjs_setup.exe"
- ps: Start-BitsTransfer -Source "https://catswords.blob.core.windows.net/welsonjs/chakracore-build/x86_release/ChakraCore.dll" -Destination "artifacts\ChakraCore.dll"
- cmd: 7z a artifacts.zip artifacts\*
artifacts:
- path: artifacts.zip
name: WelsonJS.Toolkit
deploy:
- provider: Webhook
url: https://app.signpath.io/API/v1/%ORGANIZATION_ID%/Integrations/AppVeyor?ProjectSlug=%PROJECT_SLUG%&SigningPolicySlug=%SIGNING_POLICY_SLUG%&ArtifactConfigurationSlug=%ARTIFACT_CONFIGURATION_SLUG%
authorization:
secure: nABfe+lksIRfS7lVnkq3EdIYNH8KOka+5ZFTUJqUW2nckBubhrlAXarbCPJHLp9FWWf3zxAWhNwT0It+qyqPRQ==
notifications:
- provider: Email
to:
- gnh1201@catswords.re.kr
subject: "Build {{status}}: {{projectName}} {{buildVersion}}"
on_build_success: false
on_build_failure: true

2
.github/FUNDING.yml vendored Normal file
View File

@ -0,0 +1,2 @@
github: gnh1201
custom: ['https://gnh1201.link']

38
.github/ISSUE_TEMPLATE/bug_report.md vendored Normal file
View File

@ -0,0 +1,38 @@
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: ''
assignees: ''
---
**Describe the bug**
A clear and concise description of what the bug is.
**To Reproduce**
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error
**Expected behavior**
A clear and concise description of what you expected to happen.
**Screenshots**
If applicable, add screenshots to help explain your problem.
**Desktop (please complete the following information):**
- OS: [e.g. iOS]
- Browser [e.g. chrome, safari]
- Version [e.g. 22]
**Smartphone (please complete the following information):**
- Device: [e.g. iPhone6]
- OS: [e.g. iOS8.1]
- Browser [e.g. stock browser, safari]
- Version [e.g. 22]
**Additional context**
Add any other context about the problem here.

View File

@ -0,0 +1,20 @@
---
name: Feature request
about: Suggest an idea for this project
title: ''
labels: ''
assignees: ''
---
**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
**Describe the solution you'd like**
A clear and concise description of what you want to happen.
**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.
**Additional context**
Add any other context or screenshots about the feature request here.

View File

@ -32,7 +32,7 @@ jobs:
strategy:
fail-fast: false
matrix:
language: [ 'csharp', 'javascript', 'python' ]
language: [ 'javascript' ]
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
# Learn more about CodeQL language support at https://git.io/codeql-language-support
@ -42,7 +42,7 @@ jobs:
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v1
uses: github/codeql-action/init@v2
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
@ -53,7 +53,7 @@ jobs:
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v1
uses: github/codeql-action/autobuild@v2
# Command-line programs to run using the OS shell.
# 📚 https://git.io/JvXDl
@ -67,4 +67,4 @@ jobs:
# make release
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1
uses: github/codeql-action/analyze@v2

51
.github/workflows/jekyll-gh-pages.yml vendored Normal file
View File

@ -0,0 +1,51 @@
# Sample workflow for building and deploying a Jekyll site to GitHub Pages
name: Deploy Jekyll with GitHub Pages dependencies preinstalled
on:
# Runs on pushes targeting the default branch
push:
branches: ["master"]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
concurrency:
group: "pages"
cancel-in-progress: false
jobs:
# Build job
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Pages
uses: actions/configure-pages@v5
- name: Build with Jekyll
uses: actions/jekyll-build-pages@v1
with:
source: ./
destination: ./_site
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
# Deployment job
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
needs: build
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4

23
.github/workflows/llm-code-review.yml vendored Normal file
View File

@ -0,0 +1,23 @@
name: AI Code Review
on:
pull_request:
types: [opened, synchronize, reopened]
issues:
types: [opened, reopened]
jobs:
repofix:
runs-on: ubuntu-latest
steps:
- name: Run RepoFixAI
uses: Manav916/llm-code-review@main
with:
groq_api_key: ${{ secrets.GROQ_API_KEY }}
groq_model: 'llama-3.3-70b-versatile'
github_token: ${{ secrets.GITHUB_TOKEN }}
# exclude_extensions: 'txt'
repo_owner: ${{ github.repository_owner }}
repo_name: ${{ github.event.repository.name }}
event_number: ${{ github.event.number || github.event.issue.number }} # when listening for both pull requests and issues
event_name: ${{ github.event_name }}

463
.gitignore vendored
View File

@ -1,3 +1,7 @@
# Created by https://www.toptal.com/developers/gitignore/api/visualstudio,node
# Edit at https://www.toptal.com/developers/gitignore?templates=visualstudio,node
### Node ###
# Logs
logs
*.log
@ -5,6 +9,7 @@ npm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-debug.log*
.pnpm-debug.log*
# Diagnostic reports (https://nodejs.org/api/report.html)
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
@ -41,8 +46,8 @@ build/Release
node_modules/
jspm_packages/
# TypeScript v1 declaration files
typings/
# Snowpack dependency directory (https://snowpack.dev/)
web_modules/
# TypeScript cache
*.tsbuildinfo
@ -53,11 +58,14 @@ typings/
# Optional eslint cache
.eslintcache
# Optional stylelint cache
.stylelintcache
# Microbundle cache
.rpt2_cache/
.rts2_cache_cjs/
.rts2_cache_es/
.rts2_cache_umd/package
.rts2_cache_umd/
# Optional REPL history
.node_repl_history
@ -68,15 +76,20 @@ typings/
# Yarn Integrity file
.yarn-integrity
# dotenv environment variables file
# dotenv environment variable files
.env
.env.test
.env.development.local
.env.test.local
.env.production.local
.env.local
# parcel-bundler cache (https://parceljs.org/)
.cache
.parcel-cache
# Next.js build output
.next
out
# Nuxt.js build / generate output
.nuxt
@ -84,13 +97,19 @@ dist
# Gatsby files
.cache/
# Comment in the public line in if your project uses Gatsby and *not* Next.js
# Comment in the public line in if your project uses Gatsby and not Next.js
# https://nextjs.org/blog/next-9-1#public-directory-support
# public
# vuepress build output
.vuepress/dist
# vuepress v2.x temp and cache directory
.temp
# Docusaurus cache and generated files
.docusaurus
# Serverless directories
.serverless/
@ -103,5 +122,433 @@ dist
# TernJS port file
.tern-port
# ChatGPT API Key
data/chatgpt-apikey.txt
# Stores VSCode versions used for testing VSCode extensions
.vscode-test
# yarn v2
.yarn/cache
.yarn/unplugged
.yarn/build-state.yml
.yarn/install-state.gz
.pnp.*
### Node Patch ###
# Serverless Webpack directories
.webpack/
# Optional stylelint cache
# SvelteKit build / generate output
.svelte-kit
### VisualStudio ###
## Ignore Visual Studio temporary files, build results, and
## files generated by popular Visual Studio add-ons.
##
## Get latest from https://github.com/github/gitignore/blob/main/VisualStudio.gitignore
# User-specific files
*.rsuser
*.suo
*.user
*.userosscache
*.sln.docstates
# User-specific files (MonoDevelop/Xamarin Studio)
*.userprefs
# Mono auto generated files
mono_crash.*
# Build results
[Dd]ebug/
[Dd]ebugPublic/
[Rr]elease/
[Rr]eleases/
x64/
x86/
[Ww][Ii][Nn]32/
[Aa][Rr][Mm]/
[Aa][Rr][Mm]64/
bld/
[Bb]in/
[Oo]bj/
[Ll]og/
[Ll]ogs/
# Visual Studio 2015/2017 cache/options directory
.vs/
# Uncomment if you have tasks that create the project's static files in wwwroot
#wwwroot/
# Visual Studio 2017 auto generated files
Generated\ Files/
# MSTest test Results
[Tt]est[Rr]esult*/
[Bb]uild[Ll]og.*
# NUnit
*.VisualState.xml
TestResult.xml
nunit-*.xml
# Build Results of an ATL Project
[Dd]ebugPS/
[Rr]eleasePS/
dlldata.c
# Benchmark Results
BenchmarkDotNet.Artifacts/
# .NET Core
project.lock.json
project.fragment.lock.json
artifacts/
# ASP.NET Scaffolding
ScaffoldingReadMe.txt
# StyleCop
StyleCopReport.xml
# Files built by Visual Studio
*_i.c
*_p.c
*_h.h
*.ilk
*.meta
*.obj
*.iobj
*.pch
*.pdb
*.ipdb
*.pgc
*.pgd
*.rsp
*.sbr
*.tlb
*.tli
*.tlh
*.tmp
*.tmp_proj
*_wpftmp.csproj
*.tlog
*.vspscc
*.vssscc
.builds
*.pidb
*.svclog
*.scc
# Chutzpah Test files
_Chutzpah*
# Visual C++ cache files
ipch/
*.aps
*.ncb
*.opendb
*.opensdf
*.sdf
*.cachefile
*.VC.db
*.VC.VC.opendb
# Visual Studio profiler
*.psess
*.vsp
*.vspx
*.sap
# Visual Studio Trace Files
*.e2e
# TFS 2012 Local Workspace
$tf/
# Guidance Automation Toolkit
*.gpState
# ReSharper is a .NET coding add-in
_ReSharper*/
*.[Rr]e[Ss]harper
*.DotSettings.user
# TeamCity is a build add-in
_TeamCity*
# DotCover is a Code Coverage Tool
*.dotCover
# AxoCover is a Code Coverage Tool
.axoCover/*
!.axoCover/settings.json
# Coverlet is a free, cross platform Code Coverage Tool
coverage*.json
coverage*.xml
coverage*.info
# Visual Studio code coverage results
*.coverage
*.coveragexml
# NCrunch
_NCrunch_*
.*crunch*.local.xml
nCrunchTemp_*
# MightyMoose
*.mm.*
AutoTest.Net/
# Web workbench (sass)
.sass-cache/
# Installshield output folder
[Ee]xpress/
# DocProject is a documentation generator add-in
DocProject/buildhelp/
DocProject/Help/*.HxT
DocProject/Help/*.HxC
DocProject/Help/*.hhc
DocProject/Help/*.hhk
DocProject/Help/*.hhp
DocProject/Help/Html2
DocProject/Help/html
# Click-Once directory
publish/
# Publish Web Output
*.[Pp]ublish.xml
*.azurePubxml
# Note: Comment the next line if you want to checkin your web deploy settings,
# but database connection strings (with potential passwords) will be unencrypted
*.pubxml
*.publishproj
# Microsoft Azure Web App publish settings. Comment the next line if you want to
# checkin your Azure Web App publish settings, but sensitive information contained
# in these scripts will be unencrypted
PublishScripts/
# NuGet Packages
*.nupkg
# NuGet Symbol Packages
*.snupkg
# The packages folder can be ignored because of Package Restore
**/[Pp]ackages/*
# except build/, which is used as an MSBuild target.
!**/[Pp]ackages/build/
# Uncomment if necessary however generally it will be regenerated when needed
#!**/[Pp]ackages/repositories.config
# NuGet v3's project.json files produces more ignorable files
*.nuget.props
*.nuget.targets
# Microsoft Azure Build Output
csx/
*.build.csdef
# Microsoft Azure Emulator
ecf/
rcf/
# Windows Store app package directories and files
AppPackages/
BundleArtifacts/
Package.StoreAssociation.xml
_pkginfo.txt
*.appx
*.appxbundle
*.appxupload
# Visual Studio cache files
# files ending in .cache can be ignored
*.[Cc]ache
# but keep track of directories ending in .cache
!?*.[Cc]ache/
# Others
ClientBin/
~$*
*~
*.dbmdl
*.dbproj.schemaview
*.jfm
*.pfx
*.publishsettings
orleans.codegen.cs
# Including strong name files can present a security risk
# (https://github.com/github/gitignore/pull/2483#issue-259490424)
#*.snk
# Since there are multiple workflows, uncomment next line to ignore bower_components
# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)
#bower_components/
# RIA/Silverlight projects
Generated_Code/
# Backup & report files from converting an old project file
# to a newer Visual Studio version. Backup files are not needed,
# because we have git ;-)
_UpgradeReport_Files/
Backup*/
UpgradeLog*.XML
UpgradeLog*.htm
ServiceFabricBackup/
*.rptproj.bak
# SQL Server files
*.mdf
*.ldf
*.ndf
# Business Intelligence projects
*.rdl.data
*.bim.layout
*.bim_*.settings
*.rptproj.rsuser
*- [Bb]ackup.rdl
*- [Bb]ackup ([0-9]).rdl
*- [Bb]ackup ([0-9][0-9]).rdl
# Microsoft Fakes
FakesAssemblies/
# GhostDoc plugin setting file
*.GhostDoc.xml
# Node.js Tools for Visual Studio
.ntvs_analysis.dat
# Visual Studio 6 build log
*.plg
# Visual Studio 6 workspace options file
*.opt
# Visual Studio 6 auto-generated workspace file (contains which files were open etc.)
*.vbw
# Visual Studio 6 auto-generated project file (contains which files were open etc.)
*.vbp
# Visual Studio 6 workspace and project file (working project files containing files to include in project)
*.dsw
*.dsp
# Visual Studio 6 technical files
# Visual Studio LightSwitch build output
**/*.HTMLClient/GeneratedArtifacts
**/*.DesktopClient/GeneratedArtifacts
**/*.DesktopClient/ModelManifest.xml
**/*.Server/GeneratedArtifacts
**/*.Server/ModelManifest.xml
_Pvt_Extensions
# Paket dependency manager
.paket/paket.exe
paket-files/
# FAKE - F# Make
.fake/
# CodeRush personal settings
.cr/personal
# Python Tools for Visual Studio (PTVS)
__pycache__/
*.pyc
# Cake - Uncomment if you are using it
# tools/**
# !tools/packages.config
# Tabs Studio
*.tss
# Telerik's JustMock configuration file
*.jmconfig
# BizTalk build output
*.btp.cs
*.btm.cs
*.odx.cs
*.xsd.cs
# OpenCover UI analysis results
OpenCover/
# Azure Stream Analytics local run output
ASALocalRun/
# MSBuild Binary and Structured Log
*.binlog
# NVidia Nsight GPU debugger configuration file
*.nvuser
# MFractors (Xamarin productivity tool) working folder
.mfractor/
# Local History for Visual Studio
.localhistory/
# Visual Studio History (VSHistory) files
.vshistory/
# BeatPulse healthcheck temp database
healthchecksdb
# Backup folder for Package Reference Convert tool in Visual Studio 2017
MigrationBackup/
# Ionide (cross platform F# VS Code tools) working folder
.ionide/
# Fody - auto-generated XML schema
FodyWeavers.xsd
# VS Code files for those working on multiple tools
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json
*.code-workspace
# Local History for Visual Studio Code
.history/
# Windows Installer files from build outputs
*.cab
*.msi
*.msix
*.msm
*.msp
# JetBrains Rider
*.sln.iml
### VisualStudio Patch ###
# Additional files built by Visual Studio
# End of https://www.toptal.com/developers/gitignore/api/visualstudio,node
bin
data/*-apikey.txt
data/*.nomedia.txt
app/assets/img/_templates
app/assets/img/_captured
settings.ini
defaultService.js
lib/*.private.js
data/python313.zip
do_not_push_production_on_friday.js

3
.gitmodules vendored Normal file
View File

@ -0,0 +1,3 @@
[submodule "WelsonJS.Toolkit/ChakraCore"]
path = WelsonJS.Toolkit/ChakraCore
url = https://github.com/chakra-core/ChakraCore

3
.sonarcloud.properties Normal file
View File

@ -0,0 +1,3 @@
sonar.issue.ignore.multicriteria=e1
sonar.issue.ignore.multicriteria.e1.ruleKey=javascript:S3504
sonar.issue.ignore.multicriteria.e1.resourceKey=**

57
.well-known/cats.txt Normal file
View File

@ -0,0 +1,57 @@
## Website-Name
WelsonJS
## Website-Purpose
WelsonJS is an open-source runtime and tooling ecosystem built on the Windows built-in ECMAScript engine (WSH/HTA). It enables desktop, console, service, and automation applications to run reliably, even under constrained or adverse environments, with minimal external dependencies.
## Contact
* [https://github.com/gnh1201/welsonjs/issues](https://github.com/gnh1201/welsonjs/issues)
* mailto:gnh1201@catswords.re.kr
* [https://catswords.social/@catswords_oss](https://catswords.social/@catswords_oss)
## Important-Links
* [https://github.com/gnh1201/welsonjs](https://github.com/gnh1201/welsonjs)
* [https://catswords.com/](https://catswords.com/)
* [https://signpath.org/projects/welsonjs/](https://signpath.org/projects/welsonjs/)
## Validation-Image
/_/
( =^.^= )
(")(")
## Feline-Registry
The following feline records describe symbolic agents associated with the WelsonJS ecosystem.
This section is inspired by the i83 cats.txt draft format, integrated within the IETF cats.txt structure.
### Cat
Name: WelCat
Role: Runtime Guardian
Breed: Digital Tabby
Location: Seoul, KR
PurrLevel: 9
Description: Represents the resilience of the WelsonJS runtime, which ensures execution stability across legacy and modern Windows environments.
### Cat
Name: ScriptTail
Role: JavaScript Debug Assistant
Breed: British Shorthair (Virtual)
Location: Code Editor
PurrLevel: 8
Description: Helps developers detect subtle logic issues within HTA/WSH scripts and WelsonJS Agent pipelines.
### Cat
Name: PhantomPaws
Role: Assembly Retrieval Agent
Breed: Midnight Black
Location: CDN Edge
PurrLevel: 10
Description: Symbolic cat for Catswords.Phantomizer, responsible for quietly fetching managed and native DLLs from the CDN and preparing them for runtime activation.

450
AGENTS.md Normal file
View File

@ -0,0 +1,450 @@
# AGENTS.md
*WelsonJS Agent Architecture Guide*
WelsonJS consists of two major execution layers:
1. **JavaScript execution environment** based on Windows Script Host (WSH) with `core-js` polyfills
2. **Native/Managed module environment** provided through the `WelsonJS.Toolkit` suite
This document defines the agents that operate inside WelsonJS, including their responsibilities, interaction boundaries, and design principles.
---
## **1. Overview & Design Principles**
WelsonJS aims to enable Windows application development using JavaScript on top of the legacy WSH engine while safely extending system-level functionality through .NET modules.
All agents follow these principles:
* **Single responsibility** — each agent performs one well-defined task
* **Minimal & explicit interfaces**
* **Security & integrity first**
* **Polyfill-based compatibility** (ES3 → ES5)
* **Graceful degradation when native modules are unavailable**
---
## **2. Agent Types**
WelsonJS defines two main categories of agents:
| Category | Description |
| -------------------------------- | -------------------------------------------------------------------------------------------------------------------------- |
| **JavaScript Runtime Agent** | Executes user scripts in a WSH + polyfill environment. Provides compatibility up to ES5 using `core-js` and related shims. |
| **Native/Managed Module Agents** | Extensions written in C# or VB.NET under the `WelsonJS.Toolkit` solution that provide system-level capabilities. |
---
## **3. JavaScript Runtime Agent**
### **3.1 Description**
The JavaScript Runtime Agent executes scripts using the Windows Script Host engine (JScript).
Although the engine itself is **ES3-level**, WelsonJS uses **core-js polyfills** to emulate many **ES5 features**, allowing more modern syntax and APIs.
### **3.2 Responsibilities**
* Load and initialize polyfills (`core-js`, `JSON2.js`, additional shims)
* Provide CommonJS-style module system (`require`, `exports`, caching, resolution)
* Execute user scripts in a controlled environment
* Provide bound APIs that connect to native agents
* Ensure minimal pollution of the global scope
* Provide compatibility with classical WSH functions and COM interoperability
* Handle script errors and propagate exceptions with useful metadata
### **3.3 Execution Constraints**
* Must assume an **ES3 core** with **ES5 via polyfills**
* Features requiring ES6+ must be explicitly shimmed or avoided
* All host-bound functionality must route through defined native agents
---
## **4. Native/Managed Module Agents (Toolkit Agents)**
The **WelsonJS.Toolkit** solution provides several functional agents designed as modular .NET libraries.
Each project acts as a distinct agent with its own role and responsibility.
---
### **4.1 Catswords.Phantomizer — Assembly Loading Agent**
**Purpose:**
Dynamic loading and resolution of native/managed assemblies.
**Responsibilities:**
* Load DLLs from disk or remote CDN
* Support `.dll.gz` compressed downloads for performance
* Perform integrity/signed verification
* Cache resolved versions locally
* Provide fallback when assemblies fail to load
**Notes:**
This agent enables WelsonJS to remain lightweight while extending capabilities dynamically.
---
### **4.2 WelsonJS.Esent — Database Access Agent**
**Purpose:**
Expose Windows native **ESENT** database engine to JavaScript.
**Responsibilities:**
* Create, open, and manage ESENT databases
* Provide JS-friendly abstraction for tables, cursors, and transactions
* Perform safe parameter marshaling
* Ensure proper disposal of unmanaged resources
* Support transactional metadata operations (e.g., metadata store, instance tracking)
---
### **4.3 WelsonJS.Cryptography — Cryptography Agent**
**Purpose:**
Provide cryptographic functions not available in WSH/JS.
**Responsibilities:**
* Expose symmetric/legacy/industrial cryptographic algorithms
* Bridge specialized Korean algorithms (SEED, ARIA, HIGHT, LEA) where required
* Provide secure random generation utilities
* Ensure compliance with expected test vectors
* Offer safe JS bindings that validate parameters and reject unsafe operations
**Additional:**
`WelsonJS.Cryptography.Test` provides validation and regression testing for algorithm correctness.
---
### **4.4 WelsonJS.Launcher — Bootstrap Agent**
**Purpose:**
Serve as the entry point of a WelsonJS application.
**Responsibilities:**
* Initialize environment
* Load Phantomizer & toolkit modules
* Load and execute the main JavaScript script
* Handle configuration (AppName, BaseUrl, service mode, etc.)
* Provide safe-mode and fallback execution
* Manage initial logging and diagnostics
**Notes:**
Launcher must start with only .NET BCL dependencies to ensure predictable initialization.
---
### **4.5 WelsonJS.Service — Windows Service Agent**
**Purpose:**
Allow WelsonJS applications to run as Windows services.
**Responsibilities:**
* Install/uninstall service
* Run JavaScript scripts in service context
* Manage service lifecycle events (start, stop)
* Provide safe shutdown & worker loop management
---
### **4.6 WelsonJS.Toolkit — General Utility Agent**
**Purpose:**
A shared utility library providing cross-cutting functionality.
Typical responsibilities include:
* IO helpers
* Reflection helpers
* JSNative bridging utilities
* Shared types and error-handling helpers
* Logging abstractions
It acts as the common foundation for other Toolkit modules.
---
## **5. Optional & Internal Agents**
### **5.1 Interop / Binding Agent**
Acts as a transport layer between JS Runtime Agent and Toolkit Agents.
Responsibilities:
* Marshal parameters and return values
* Validate type compatibility
* Protect against injection or malformed input
* Normalize exceptions into JS-friendly error objects
* Enforce version negotiation and capability detection
Often implemented inside each Toolkit module but may be abstracted.
---
### **5.2 Security / Policy Agent**
Provides security boundaries.
Responsibilities:
* Module integrity verification
* Allowed module list management
* Restricting file system or registry access
* Enforcing sandbox policies for script execution
* Logging suspicious activity
---
### **5.3 Fallback / Compatibility Agent**
Ensures application execution even without native modules.
Responsibilities:
* JS-only polyfill alternatives
* Reduced functionality mode
* Diagnostics for missing dependencies
---
## **6. Agent Interaction Model**
```text
[WelsonJS.Launcher]
↓ Initialization + Configuration
[JavaScript Runtime Agent] ←→ [Toolkit Agents]
↑ ↑
(Interop Layer) (Security/Policy)
```
* **Launcher** bootstraps the system.
* **JS Runtime Agent** handles all user logic.
* **Toolkit Agents** provide extended OS-level capabilities.
* **Interop Layer** ensures safe crossing between JS and .NET worlds.
* **Security Agent** governs what is allowed.
---
## **7. Implementation Guidelines**
* Follow "least-privilege" principles for all native module operations.
* All JS ↔ Native APIs must be explicit and documented.
* Native agents must degrade gracefully when unavailable.
* Polyfills must not assume ES6+ features unless explicitly shimmed.
* Fallback behaviors must be deterministic and logged.
* All agents must respect long-term compatibility from Windows XP → Windows 10/11.
---
## **8. Purpose of This Document**
AGENTS.md provides a shared understanding across contributors so that:
* New toolkit modules follow consistent architecture.
* JS runtime bindings remain predictable and safe.
* Extension developers can easily understand boundaries and responsibilities.
* The ecosystem grows without introducing breaking or conflicting functionality.
---
## **9. Test Structure (Test Plan)**
WelsonJS uses **JSON-based test profiles** plus a script runner (`testloader.js`) to verify both the JavaScript Runtime Agent and the Toolkit Agents.
A representative profile is `test-oss-korea-2023.json`, used in the 2023 South Korea OSS Contest to validate the WelsonJS environment.
---
### **9.1 Testing Approach**
* Tests are grouped into **profiles** (single JSON file per profile).
* Each profile describes:
* Test **metadata** (description, updated date, dependencies, authors, references, tags)
* **Schema version**
* An array of **test entries**, each with `id`, `description`, and `tags`
* `testloader.js`:
* Loads a given profile JSON
* Interprets each test `id` as a runnable unit (usually bound to a script or implementation defined inside WelsonJS)
* Executes them in the same WSH + polyfill environment that real users will use
* Aggregates pass/fail status and reports the result
This keeps tests:
* Close to **real execution** (same engine, same polyfills)
* Capable of testing **JS-only behavior** and **JS ↔ native agent integration**
* Easy to extend by just adding new entries into JSON
---
### **9.2 Test Layers Mapped to Existing IDs**
The existing test profile covers multiple layers of the system.
1. **JavaScript Runtime / Polyfill Layer**
* `es5_polyfills` checks whether polyfills above ES5 level run successfully on the built-in engine.
* These tests verify `core-js`, JSON handling, and basic language/runtime correctness.
2. **Windows Systems & Toolkit Integration**
* Registry: `registry_find_provider`, `registry_write`, `registry_read`
* WMI: `wmi_create_object`, `wmi_execute_query`, `wmi_result_query`
* Shell: `shell_create_object`, `shell_build_command_line`, `shell_set_charset`, `shell_working_directory`, `shell_create_process`, `shell_execute`, `shell_run`, `shell_run_as`, `shell_find_my_documents`, `shell_release`
* PowerShell: `powershell_set_command`, `powershell_set_file`, `powershell_set_uri`, `powershell_execute`, `powershell_run_as`
* System information: `system_resolve_env`, `system_check_as`, `system_get_os_version`, `system_get_architecture`, `system_get_uuid`, `system_get_working_directory`, `system_get_script_directory`, `system_get_network_interfaces`, `system_get_process_list`, `system_get_process_list_by_name`, `system_register_uri`, `system_pipe_ipc`
These exercise the **Interop/Binding Agent** and various **Toolkit Agents** that expose Windows APIs.
3. **Human Interface / Virtual Input (VHID)**
* `vhid_find_window`, `vhid_send_click`, `vhid_send_keys`, `vhid_send_key_enter`, `vhid_send_key_functions`, `vhid_alert`, `vhid_confirm`, `vhid_prompt`
These validate keyboard/mouse simulation and dialog APIs, ensuring the Virtual Human Interface agent behaves as expected.
4. **Network & HTTP Layer**
* `network_http_get`, `network_http_post`, `network_http_extended`, `network_attach_debugger`, `network_detect_charset`, `network_detect_http_ssl`, `network_send_icmp`
These tests exercise HTTP/ICMP functionality and optional debugger integration (e.g., Fiddler) via Toolkit Agents.
5. **Advanced String / NLP / Utility**
* `extramath_dtm`, `extramath_cosine_similarity`, `base64_encode`, `base64_decode`
These validate extra math/string/NLP-style helpers that may be implemented in JS or as native helpers.
6. **Chromium / Browser Control**
* `chromium_run`, `chromium_create_profile`, `chromium_run_incognito`, `chromium_navigate`, `chromium_get_active_pages`, `chromium_find_page_by_id`, `chromium_find_pages_by_title`, `chromium_move_focused`, `chromium_adjust_window_size`, `chromium_get_element_position`, `chromium_get_mapreduced_element_position`, `chromium_set_value_to_textbox`, `chromium_send_click`, `chromium_send_keys`, `chromium_auto_scroll_until_end`
These test the ChromiumDevTools-related agent responsible for controlling a Chromium-based browser.
7. **gRPC & GUI Integration**
* gRPC: `grpc_run_server`, `grpc_receive_command`
* WebView: `gui_check`
These validate that **network service agents** (gRPC) and **GUI/WebView integration** work correctly in real environments.
---
### **9.3 Test Profile Schema**
A test profile JSON follows this general schema:
* **description**: Human-readable description of the profile
* **updated_on**: Last update date (string, e.g. `"2023-10-30"`)
* **dependencies**: Object listing required WelsonJS version or other requirements
* **authors**: Array of strings identifying authors
* **references**: Array of related URLs (repository, social, external descriptions)
* **tags**: Profile-wide tags (technologies, platforms, etc.)
* **schema**:
* `version`: Schema version used by `testloader.js` (e.g. `"0.2"`)
* **tests**:
* Array of test objects, each having:
* `id`: Unique test identifier (string)
* `description`: What the test checks (string)
* `tags`: Array of tags describing category and domain
Example (simplified):
```json
{
"description": "2023 South Korea OSS Contest Test Profile for WelsonJS",
"updated_on": "2023-10-30",
"dependencies": {
"welsonjs": "0.2.7"
},
"schema": {
"version": "0.2"
},
"tests": [
{
"id": "es5_polyfills",
"description": "Checks whether polyfills above the ES5 level run successfully (using Windows' built-in engine).",
"tags": ["JavaScript Engine", "ECMAScript Polyfills"]
}
]
}
```
> The exact semantics for how each `id` maps to a concrete script or implementation are defined in `testloader.js` and the surrounding WelsonJS test harness.
---
### **9.4 Using `testloader.js`**
`testloader.js` is the standard runner that:
1. Accepts one or more **profile JSON** paths (e.g., `test-oss-korea-2023.json`).
2. Parses the profile according to the schema version.
3. Iterates over `tests[]`, and for each `id`:
* Resolves the underlying implementation (JS file, bound function, etc.)
* Executes the test logic in the WSH + polyfill environment
* Captures success/failure and any diagnostic output
4. Produces a summary result (per test and overall).
When adding or modifying tests:
* Prefer **extending existing profiles** rather than inventing new formats.
* Keep `id` stable once published, so existing CI or documentation references do not break.
* Use `tags` to reflect which agent(s) a test touches (e.g., `"Windows Systems"`, `"Chromium-Based Browser"`, `"gRPC"`).
---
### **9.5 Naming & Organization**
Recommended file organization:
```text
/tests
test-oss-korea-2023.json # Contest profile (broad coverage)
... # Future profiles (e.g., cryptography-only, ESENT-only)
testloader.js
```
Guidelines:
* Use **profile-level tags** to describe the scope (`"windows"`, `"wsh"`, `"chromium"`, `"grpc"`, etc.).
* Keep large, real-world coverage (like the OSS contest profile) but also allow smaller focused profiles for specific agents (e.g., ESENT regression suite, Cryptography regression suite).
* For new features or agents, introduce corresponding `tests[]` entries with descriptive `id` and `description`, and appropriate `tags`.
---
### **9.6 Regression & Compatibility**
Because WelsonJS targets a wide range of Windows environments:
* Use the existing wide-coverage profile (like the OSS contest profile) as a **baseline regression suite**.
* When fixing a bug in any agent (e.g., ESENT, Chromium control, VHID input, HTTP stack):
* Add or update a test entry in a JSON profile.
* Ensure `testloader.js` can run it in automated environments.
* Keep compatibility in mind: if behavior must differ by OS version, reflect that in tests or tags (e.g., Windows XP vs Windows 10).
---
### **9.7 CI / Automation (Optional)**
If a CI pipeline is configured:
* Add a step that:
* Invokes `testloader.js` on one or more profiles
* Fails the build if any test in the profile fails
* Optionally support:
* Running a **quick subset** (e.g., only `es5_polyfills` + core system tests)
* Running the full OSS profile for release candidates or nightly builds

11
CITATION.cff Normal file
View File

@ -0,0 +1,11 @@
cff-version: 1.2.0
message: "If you use this software, please cite it as below."
authors:
- family-names: "Go"
given-names: "Namhyeon"
orcid: "https://orcid.org/0009-0006-8421-0911"
title: "WelsonJS"
version: 0.2.7.12
doi: 10.5281/zenodo.11382384
date-released: 2024-05-29
url: "https://github.com/gnh1201/welsonjs"

1
CNAME Normal file
View File

@ -0,0 +1 @@
welson.js.org

70
CODE_OF_CONDUCT.md Normal file
View File

@ -0,0 +1,70 @@
# Code of Conduct - WelsonJS
## Our Pledge
In the interest of fostering an open and welcoming environment, we as
contributors and maintainers pledge to make participation in our project and
our community a harassment-free experience for everyone, regardless of age, body
size, disability, ethnicity, sex characteristics, gender identity and expression,
level of experience, education, socio-economic status, nationality, personal
appearance, race, religion, or sexual identity and orientation.
## Our Standards
Examples of behavior that contributes to a positive environment for our
community include:
* Demonstrating empathy and kindness toward other people
* Being respectful of differing opinions, viewpoints, and experiences
* Giving and gracefully accepting constructive feedback
* Accepting responsibility and apologizing to those affected by our mistakes,
and learning from the experience
* Focusing on what is best not just for us as individuals, but for the
overall community
Examples of unacceptable behavior include:
* The use of sexualized language or imagery, and sexual attention or
advances
* Trolling, insulting or derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or email
address, without their explicit permission
* Other conduct which could reasonably be considered inappropriate in a
professional setting
## Our Responsibilities
Project maintainers are responsible for clarifying and enforcing our standards of
acceptable behavior and will take appropriate and fair corrective action in
response to any instances of unacceptable behavior.
Project maintainers have the right and responsibility to remove, edit, or reject
comments, commits, code, wiki edits, issues, and other contributions that are
not aligned to this Code of Conduct, or to ban
temporarily or permanently any contributor for other behaviors that they deem
inappropriate, threatening, offensive, or harmful.
## Scope
This Code of Conduct applies within all community spaces, and also applies when
an individual is officially representing the community in public spaces.
Examples of representing our community include using an official e-mail address,
posting via an official social media account, or acting as an appointed
representative at an online or offline event.
## Enforcement
Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported to the community leaders responsible for enforcement at <abuse@catswords.net>.
All complaints will be reviewed and investigated promptly and fairly.
All community leaders are obligated to respect the privacy and security of the
reporter of any incident.
## Attribution
This Code of Conduct is adapted from the [Contributor Covenant](https://contributor-covenant.org/), version
[1.4](https://www.contributor-covenant.org/version/1/4/code-of-conduct/code_of_conduct.md) and
[2.0](https://www.contributor-covenant.org/version/2/0/code_of_conduct/code_of_conduct.md),
and was generated by [contributing-gen](https://github.com/bttger/contributing-gen).

146
CONTRIBUTING.md Normal file
View File

@ -0,0 +1,146 @@
<!-- omit in toc -->
# Contributing to WelsonJS
First off, thanks for taking the time to contribute! ❤️
All types of contributions are encouraged and valued. See the [Table of Contents](#table-of-contents) for different ways to help and details about how this project handles them. Please make sure to read the relevant section before making your contribution. It will make it a lot easier for us maintainers and smooth out the experience for all involved. The community looks forward to your contributions. 🎉
> And if you like the project, but just don't have time to contribute, that's fine. There are other easy ways to support the project and show your appreciation, which we would also be very happy about:
> - Star the project
> - Tweet about it
> - Refer this project in your project's readme
> - Mention the project at local meetups and tell your friends/colleagues
<!-- omit in toc -->
## Table of Contents
- [Code of Conduct](#code-of-conduct)
- [I Have a Question](#i-have-a-question)
- [I Want To Contribute](#i-want-to-contribute)
- [Reporting Bugs](#reporting-bugs)
- [Suggesting Enhancements](#suggesting-enhancements)
- [Your First Code Contribution](#your-first-code-contribution)
- [Improving The Documentation](#improving-the-documentation)
- [Styleguides](#styleguides)
- [Commit Messages](#commit-messages)
- [Join The Project Team](#join-the-project-team)
## Code of Conduct
This project and everyone participating in it is governed by the [WelsonJS Code of Conduct](https://github.com/gnh1201/welsonjs/blob/master/CODE_OF_CONDUCT.md).
By participating, you are expected to uphold this code. Please report unacceptable behavior to <abuse@catswords.net>.
## I Have a Question
> If you want to ask a question, we assume that you have read the available [Documentation](https://catswords-oss.rdbl.io/5719744820/5330609327).
Before you ask a question, it is best to search for existing [Issues](https://github.com/gnh1201/welsonjs/issues) that might help you. In case you have found a suitable issue and still need clarification, you can write your question in this issue. It is also advisable to search the internet for answers first.
If you then still feel the need to ask a question and need clarification, we recommend the following:
- Open an [Issue](https://github.com/gnh1201/welsonjs/issues/new).
- Provide as much context as you can about what you're running into.
- Provide project and platform versions (nodejs, npm, etc), depending on what seems relevant.
We will then take care of the issue as soon as possible.
You might want to create a separate issue tag for questions and include it in this description. People should then tag their issues accordingly.
Depending on how large the project is, you may want to outsource the questioning, e.g. to Stack Overflow. You may add additional contact and information possibilities:
- ActivityPub
- Stack Overflow tag or Public Forums
- E-Mail List
## I Want To Contribute
> ### Legal Notice <!-- omit in toc -->
> When contributing to this project, you must agree that you have authored 100% of the content, that you have the necessary rights to the content and that the content you contribute may be provided under the project license.
### Reporting Bugs
<!-- omit in toc -->
#### Before Submitting a Bug Report
A good bug report shouldn't leave others needing to chase you up for more information. Therefore, we ask you to investigate carefully, collect information and describe the issue in detail in your report. Please complete the following steps in advance to help us fix any potential bug as fast as possible.
- Make sure that you are using the latest version.
- Determine if your bug is really a bug and not an error on your side e.g. using incompatible environment components/versions (Make sure that you have read the [documentation](https://catswords.social/@catswords_oss). If you are looking for support, you might want to check [this section](#i-have-a-question)).
- To see if other users have experienced (and potentially already solved) the same issue you are having, check if there is not already a bug report existing for your bug or error in the [bug tracker](https://github.com/gnh1201/welsonjs/issues?q=label%3Abug).
- Also make sure to search the internet (including Stack Overflow) to see if users outside of the GitHub community have discussed the issue.
- Collect information about the bug:
- Stack trace (Traceback)
- OS, Platform and Version (Windows, Linux, macOS, x86, ARM)
- Version of the interpreter, compiler, SDK, runtime environment, package manager, depending on what seems relevant.
- Possibly your input and the output
- Can you reliably reproduce the issue? And can you also reproduce it with older versions?
<!-- omit in toc -->
#### How Do I Submit a Good Bug Report?
> You must never report security related issues, vulnerabilities or bugs including sensitive information to the issue tracker, or elsewhere in public. Instead sensitive bugs must be sent by email to <abuse@catswords.re.kr>.
<!-- You may add a PGP key to allow the messages to be sent encrypted as well. -->
We use GitHub issues to track bugs and errors. If you run into an issue with the project:
- Open an [Issue](https://github.com/gnh1201/welsonjs/issues/new). (Since we can't be sure at this point whether it is a bug or not, we ask you not to talk about a bug yet and not to label the issue.)
- Explain the behavior you would expect and the actual behavior.
- Please provide as much context as possible and describe the *reproduction steps* that someone else can follow to recreate the issue on their own. This usually includes your code. For good bug reports you should isolate the problem and create a reduced test case.
- Provide the information you collected in the previous section.
Once it's filed:
- The project team will label the issue accordingly.
- A team member will try to reproduce the issue with your provided steps. If there are no reproduction steps or no obvious way to reproduce the issue, the team will ask you for those steps and mark the issue as `needs-repro`. Bugs with the `needs-repro` tag will not be addressed until they are reproduced.
- If the team is able to reproduce the issue, it will be marked `needs-fix`, as well as possibly other tags (such as `critical`), and the issue will be left to be [implemented by someone](#your-first-code-contribution).
<!-- You might want to create an issue template for bugs and errors that can be used as a guide and that defines the structure of the information to be included. If you do so, reference it here in the description. -->
### Suggesting Enhancements
This section guides you through submitting an enhancement suggestion for WelsonJS, **including completely new features and minor improvements to existing functionality**. Following these guidelines will help maintainers and the community to understand your suggestion and find related suggestions.
<!-- omit in toc -->
#### Before Submitting an Enhancement
- Make sure that you are using the latest version.
- Read the [documentation](https://catswords-oss.rdbl.io/5719744820/5330609327) carefully and find out if the functionality is already covered, maybe by an individual configuration.
- Perform a [search](https://github.com/gnh1201/welsonjs/issues) to see if the enhancement has already been suggested. If it has, add a comment to the existing issue instead of opening a new one.
- Find out whether your idea fits with the scope and aims of the project. It's up to you to make a strong case to convince the project's developers of the merits of this feature. Keep in mind that we want features that will be useful to the majority of our users and not just a small subset. If you're just targeting a minority of users, consider writing an add-on/plugin library.
<!-- omit in toc -->
#### How Do I Submit a Good Enhancement Suggestion?
Enhancement suggestions are tracked as [GitHub issues](https://github.com/gnh1201/welsonjs/issues).
- Use a **clear and descriptive title** for the issue to identify the suggestion.
- Provide a **step-by-step description of the suggested enhancement** in as many details as possible.
- **Describe the current behavior** and **explain which behavior you expected to see instead** and why. At this point you can also tell which alternatives do not work for you.
- You may want to **include screenshots and animated GIFs** which help you demonstrate the steps or point out the part which the suggestion is related to. You can use [this tool](https://www.cockos.com/licecap/) to record GIFs on macOS and Windows, and [this tool](https://github.com/colinkeenan/silentcast) or [this tool](https://github.com/GNOME/byzanz) on Linux. <!-- this should only be included if the project has a GUI -->
- **Explain why this enhancement would be useful** to most WelsonJS users. You may also want to point out the other projects that solved it better and which could serve as inspiration.
<!-- You might want to create an issue template for enhancement suggestions that can be used as a guide and that defines the structure of the information to be included. If you do so, reference it here in the description. -->
### Your First Code Contribution
Just Notepad, in Windows machine.
## Styleguides
### Commit Messages
Flexible. We will respect your style.
## Join The Project Team
Contact us:
* ActivityPub [@catswords_oss@catswords.social](https://catswords.social/@catswords_oss)
* XMPP [catswords@conference.omemo.id](xmpp:catswords@conference.omemo.id?join)
* [Join Catswords OSS on Microsoft Teams (teams.live.com)](https://teams.live.com/l/community/FEACHncAhq8ldnojAI)
* [Join Catswords OSS #welsonjs on Discord (discord.gg)](https://discord.gg/XKG5CjtXEj)
## Attribution
This guide is based on the **contributing-gen**. [Make your own](https://github.com/bttger/contributing-gen)!

View File

@ -1,8 +0,0 @@
# These are supported funding model platforms
github: gnh1201
open_collective: welsonjs
liberapay: catswords
custom: ['https://www.buymeacoffee.com/catswords']
patreon: catswords # Replace with a single Patreon username
ko_fi: catswords

View File

@ -1,5 +1,4 @@
Microsoft Reciprocal License (MS-RL)
SPDX Short identifier: MS-RL
Microsoft Reciprocal License (Ms-RL)
This license governs use of the accompanying software. If you use the software, you accept this license. If you do not accept the license, do not use the software.
@ -29,35 +28,3 @@ A "contributor" is any person that distributes its contribution under this licen
(E) If you distribute any portion of the software in source code form, you may do so only under this license by including a complete copy of this license with your distribution. If you distribute any portion of the software in compiled or object code form, you may only do so under a license that complies with this license.
(F) The software is licensed "as-is." You bear the risk of using it. The contributors give no express warranties, guarantees or conditions. You may have additional consumer rights under your local laws which this license cannot change. To the extent permitted under your local laws, the contributors exclude the implied warranties of merchantability, fitness for a particular purpose and non-infringement.
Microsoft 상호 라이선스(MS-RL)
SPDX 짧은 식별자: MS-RL
이 라이센스는 함께 제공되는 소프트웨어의 사용에 적용됩니다. 소프트웨어를 사용하는 경우 이 라이센스에 동의하는 것입니다. 라이센스에 동의하지 않으면 소프트웨어를 사용하지 마십시오.
1. 정의
"복제", "복제물", "파생 저작물" 및 "배포"라는 용어는 여기에서 미국 저작권법과 동일한 의미를 갖습니다.
"기여"은 원본 소프트웨어 또는 소프트웨어에 대한 추가 또는 변경 사항입니다.
"기여자"는 이 라이선스에 따라 기여를 배포하는 모든 사람입니다.
"라이선스 지적재산권"은 기여에 대해 직접 읽는 기여자의 지적재산권 주장입니다.
2. 권리 부여
(A) 저작권 부여 - 섹션 3의 라이선스 조건 및 제한 사항을 포함하여 이 라이선스의 조건에 따라 각 기여자는 자신의 기여를 복제하고 파생 작업을 준비할 수 있는 비독점적이고 전세계적인 로열티 없는 저작권 라이선스를 부여합니다. 기여 및 귀하가 만든 기여 또는 파생 작업을 배포합니다.
(B) 지적재산권 부여 - 섹션 3의 라이선스 조건 및 제한 사항을 포함하여 이 라이선스의 조건에 따라 각 기여자는 라이선스가 부여된 지적재산권에 따라 귀하에게 비독점적이고 전 세계적으로 사용료가 없는 라이선스를 부여합니다. 여기에는 판매, 판매 제안, 수입 및 또는 소프트웨어에 대한 기여 또는 소프트웨어 기여의 파생물을 처분하는 행위를 포함합니다.
3. 조건 및 제한
(A) 상호 부여 - 소프트웨어의 코드(소스코드 또는 바이너리 형식)가 포함된 배포하는 모든 파일의 경우 해당 파일에 적용되는 라이선스의 사본과 함께 해당 파일의 소스코드를 수신자에게 제공해야 합니다. . 귀하는 전적으로 귀하의 저작물이며 귀하가 선택한 조건에 따라 소프트웨어의 코드를 포함하지 않는 다른 파일에 라이선스를 부여할 수 있습니다.
(B) 상표 사용권 없음 - 이 사용권은 기여자의 이름, 로고 또는 상표를 사용할 수 있는 권한을 부여하지 않습니다.
(C) 귀하가 소프트웨어에 의해 침해되었다고 주장하는 지적재산권에 대해 기여자에 대해 지적재산권 청구를 제기하는 경우 해당 기여자의 소프트웨어에 대한 귀하의 지적재산권 라이선스는 자동으로 종료됩니다.
(D) 소프트웨어의 일부를 배포하는 경우 소프트웨어에 있는 모든 저작권, 지적재산권, 상표 및 귀속 고지를 보유해야 합니다.
(E) 소프트웨어의 일부를 소스코드 형식으로 배포하는 경우 배포와 함께 이 라이센스의 전체 사본을 포함하여 이 라이센스 하에서만 그렇게 할 수 있습니다. 소프트웨어의 일부를 컴파일된 또는 개체 코드 형식으로 배포하는 경우 이 라이센스를 준수하는 라이센스 하에서만 배포할 수 있습니다.
(F) 소프트웨어는 "있는 그대로" 사용이 허가됩니다. 당신은 그것을 사용할 위험을 감수합니다. 기여자는 명시적 보증, 보증 또는 조건을 제공하지 않습니다. 귀하는 현지 법률에 따라 이 라이선스가 변경할 수 없는 추가적인 소비자 권리를 가질 수 있습니다. 현지 법률에서 허용하는 범위 내에서 기여자는 상품성, 특정 목적에의 적합성 및 비침해성에 대한 묵시적 보증을 배제합니다.

218
README.md
View File

@ -1,75 +1,87 @@
# welsonjs
WelsonJS - Build a Windows app on the Windows built-in JavaScript engine.
![(Image) A man programming against a power plant facility, the screen that the man is watching shows the Windows logo](app/assets/img/overture.jpg)
[![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgithub.com%2Fgnh1201%2Fwelsonjs.svg?type=shield)](https://app.fossa.com/projects/git%2Bgithub.com%2Fgnh1201%2Fwelsonjs?ref=badge_shield)
[![AppVeyor Status](https://ci.appveyor.com/api/projects/status/github/gnh1201/welsonjs?svg=true)](https://ci.appveyor.com/project/gnh1201/welsonjs)
[![DOI 10.5281/zenodo.11382384](https://zenodo.org/badge/DOI/10.5281/zenodo.11382384.svg)](https://doi.org/10.5281/zenodo.11382384)
[![ChatGPT available](https://img.shields.io/badge/ChatGPT-74aa9c?logo=openai&logoColor=white)](#)
[![Google Gemini available](https://img.shields.io/badge/Gemini-886FBF?logo=googlegemini&logoColor=fff)](#)
[![slideshare.net presentation](https://img.shields.io/badge/SlideShare-black?logo=slideshare)](https://www.slideshare.net/slideshow/welsonjs-javascript-framework-presentation-2024/276005486)
[![YouTube promotion video](https://img.shields.io/badge/YouTube-red?logo=youtube)](https://youtu.be/JavH7Dms8-U)
[![Discord chat](https://img.shields.io/discord/359930650330923008?logo=discord)](https://discord.gg/XKG5CjtXEj)
[![Trustpilot](https://img.shields.io/badge/Trustpilot-00B67A?logo=trustpilot&logoColor=fff)](https://www.trustpilot.com/review/catswords.com)
[![Open to work](https://img.shields.io/badge/%23-OPENTOWORK-green)](https://github.com/gnh1201/welsonjs/discussions/167)
[![DeepWiki](https://img.shields.io/badge/DeepWiki-gnh1201%2Fwelsonjs-blue.svg?logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACwAAAAyCAYAAAAnWDnqAAAAAXNSR0IArs4c6QAAA05JREFUaEPtmUtyEzEQhtWTQyQLHNak2AB7ZnyXZMEjXMGeK/AIi+QuHrMnbChYY7MIh8g01fJoopFb0uhhEqqcbWTp06/uv1saEDv4O3n3dV60RfP947Mm9/SQc0ICFQgzfc4CYZoTPAswgSJCCUJUnAAoRHOAUOcATwbmVLWdGoH//PB8mnKqScAhsD0kYP3j/Yt5LPQe2KvcXmGvRHcDnpxfL2zOYJ1mFwrryWTz0advv1Ut4CJgf5uhDuDj5eUcAUoahrdY/56ebRWeraTjMt/00Sh3UDtjgHtQNHwcRGOC98BJEAEymycmYcWwOprTgcB6VZ5JK5TAJ+fXGLBm3FDAmn6oPPjR4rKCAoJCal2eAiQp2x0vxTPB3ALO2CRkwmDy5WohzBDwSEFKRwPbknEggCPB/imwrycgxX2NzoMCHhPkDwqYMr9tRcP5qNrMZHkVnOjRMWwLCcr8ohBVb1OMjxLwGCvjTikrsBOiA6fNyCrm8V1rP93iVPpwaE+gO0SsWmPiXB+jikdf6SizrT5qKasx5j8ABbHpFTx+vFXp9EnYQmLx02h1QTTrl6eDqxLnGjporxl3NL3agEvXdT0WmEost648sQOYAeJS9Q7bfUVoMGnjo4AZdUMQku50McDcMWcBPvr0SzbTAFDfvJqwLzgxwATnCgnp4wDl6Aa+Ax283gghmj+vj7feE2KBBRMW3FzOpLOADl0Isb5587h/U4gGvkt5v60Z1VLG8BhYjbzRwyQZemwAd6cCR5/XFWLYZRIMpX39AR0tjaGGiGzLVyhse5C9RKC6ai42ppWPKiBagOvaYk8lO7DajerabOZP46Lby5wKjw1HCRx7p9sVMOWGzb/vA1hwiWc6jm3MvQDTogQkiqIhJV0nBQBTU+3okKCFDy9WwferkHjtxib7t3xIUQtHxnIwtx4mpg26/HfwVNVDb4oI9RHmx5WGelRVlrtiw43zboCLaxv46AZeB3IlTkwouebTr1y2NjSpHz68WNFjHvupy3q8TFn3Hos2IAk4Ju5dCo8B3wP7VPr/FGaKiG+T+v+TQqIrOqMTL1VdWV1DdmcbO8KXBz6esmYWYKPwDL5b5FA1a0hwapHiom0r/cKaoqr+27/XcrS5UwSMbQAAAABJRU5ErkJggg==)](https://deepwiki.com/gnh1201/welsonjs)
Now, You can build an Windows desktop app with JavaScript, TypeScript, ReScript, and HTML/CSS on Windows built-in ECMAScript engine.
<img src="https://catswords.blob.core.windows.net/welsonjs/images/logo.svg" height="32" alt="WelsonJS logo with four diagonal stripes in red, green, blue, and yellow, overlaid with the letters JS."/> WelsonJS - Build a Windows app on the Windows built-in JavaScript engine.
WelsonJS = ***W***indows + ***El***ectr***on***-like + ***Javascript(JS)*** + [Your contribution](FUNDING.yml)
![A Cover Image: Windows in 1999](https://catswords.blob.core.windows.net/welsonjs/images/cover.png)
Dual license notice: The default license for this project is GPL 3.0. However, if the GPL 3.0 license is not compatible with Microsoft products, it is subject to the MS-RL license.
Now, You can build a Windows desktop app with JavaScript, TypeScript, CoffeeScript, ReScript, and HTML/CSS on Windows built-in ECMAScript engine.
I presented this project in [the open-source contest in the Republic of Korea in November 2023](https://www.slideshare.net/gnh1201/welsonjs-2023).
WelsonJS = ***W***indows + ***El***ectr***on***-like + ***Javascript(JS)*** + :heart:[Contributions](https://github.com/sponsors/gnh1201)
* :kissing_cat: [Download Latest WelsonJS Launcher (catswords.blob.core.windows.net)](https://catswords.blob.core.windows.net/welsonjs/welsonjs_launcher_latest.zip)
* :rocket: [Launch the WelsonJS environment on Microsoft Azure (azuremarketplace.microsoft.com)](https://azuremarketplace.microsoft.com/en-us/marketplace/apps/catswords.catswords-welsonjs-feb2025-02?tab=Overview)
**Note**: The default license for this project is GPL 3.0. However, if the GPL 3.0 license is not compatible with Microsoft products, it is subject to the MS-RL license.
## Sponsors
* :octocat: [GitHub Sponsors](https://github.com/sponsors/gnh1201), :coffee: [Buy me a coffee](https://buymeacoffee.com/catswords)
* <img src="https://catswords.blob.core.windows.net/welsonjs/images/serpapi_logo_32.png" height="32" alt=""/> [SerpApi: Search API](https://serpapi.com/?utm_source=welsonjs) - Scrape search engines results with simple API.
* <img src="https://catswords.blob.core.windows.net/welsonjs/images/logo_oss.gif" height="32" alt=""/> [Open SW Portal](https://oss.kr), NIPA National IT Industry Promotion Agency<sup>(정보통신산업진흥원)</sup>
* <img src="https://catswords.blob.core.windows.net/welsonjs/images/signpath_logo.png" height="32" alt=""/> Free code signing provided by [SignPath.io](https://signpath.io), certificate by [SignPath Foundation](https://signpath.org/)
* <img src="https://catswords.blob.core.windows.net/welsonjs/images/f1security_logo.png" height="32" alt=""/> [F1Security<sup>(에프원시큐리티)</sup>](https://f1security.co.kr/) provides [industry-leading](https://www.ksecurity.or.kr/kisis/subIndex/469.do) web security services.
* <img src="https://catswords.blob.core.windows.net/welsonjs/images/microsoft_logo.png" height="32" alt=""/> [Microsoft ISV Success Program](https://www.microsoft.com/en-us/isv/isv-success), Grow your business with powerful tools.
* :zap: Integrations (e.g., Aviation, Shopping)...
## System Requirements
* **Operating Systems**: Windows XP SP3 or later (Currently, Windows 11 24H2)
* For systems running Windows 2000 or earlier versions (e.g., 95, 98, Me), please contact us separately.
## Why Choose WelsonJS?
WelsonJS is an advanced JavaScript framework designed to operate in extreme conditions where conventional solutions may fail. Unlike traditional JavaScript frameworks, WelsonJS focuses on executing scripts in constrained environments, ensuring reliable performance even with minimal system resources.
### Key Features
* **Lightweight and Efficient**: Optimized for environments with limited computing power, WelsonJS delivers efficient script execution without unnecessary overhead.
* **Windows ECMAScript Compatibility**: Designed to run seamlessly on Windows-based systems, adhering to the ECMAScript standard while maintaining lightweight execution.
* **Standalone Execution**: Unlike well-known JavaScript runtimes, which require external dependencies, a WelsonJS application can operate as a self-contained app, making it suitable for embedded systems and isolated environments.
* **Security-Oriented**: Built with security in mind, ensuring controlled execution of scripts without compromising system integrity.
* **Minimalist Design**: WelsonJS strips away unnecessary complexities, focusing on core functionalities that maximize performance and reliability.
### Use Cases
* **Legacy System Integration**: WelsonJS provides a practical solution for running JavaScript on older Windows environments where modern frameworks are not feasible.
* **Automation and Scripting**: Ideal for executing scripts in constrained environments, enabling automated workflows and system-level scripting.
* **Embedded Applications**: Suitable for devices and systems with strict resource constraints, such as industrial controllers and embedded platforms.
* **Security-Focused Environments**: Useful in security-sensitive applications where dependencies on external network connections are limited.
* **Office Automation**: Suitable for office automation tasks using Microsoft Office and various LLM-based AI (such as ChatGPT).
WelsonJS is tailored for developers who need a reliable, lightweight JavaScript framework in environments where traditional solutions are impractical. Whether working with legacy systems, embedded devices, or security-critical applications, WelsonJS ensures that JavaScript remains a viable and efficient option.
## Structure
![Structure](app/assets/img/structure.png)
![The structure of the WelsonJS framework can be extended based on whether it operates in a console (command prompt) environment, a GUI (with HTML/CSS) environment, or a service environment, with the `app.js` file at its core.](https://ics.catswords.net/structure.png)
## Specifications
- Built-in transpilers: [TypeScript](https://www.typescriptlang.org/), [Rescript](https://rescript-lang.org/), [CoffeeScript 2](https://coffeescript.org/), [LiveScript](https://livescript.net/)
- Ready to use on Windows machine immediately. No require additional software installation.
- ES5(ECMAScript 5), XML, JSON, YAML compatibility
- [github.com/zloirock/core-js](https://github.com/zloirock/core-js)
- [github.com/douglascrockford/JSON-js](https://github.com/douglascrockford/JSON-js) (aka. JSON2.js)
- [github.com/nodeca/js-yaml](https://github.com/nodeca/js-yaml)
- HTML5, CSS3 compatibility
- [github.com/aFarkas/html5shiv](https://github.com/aFarkas/html5shiv)
- [github.com/parndt/jquery-html5-placeholder-shim](https://github.com/parndt/jquery-html5-placeholder-shim)
- [github.com/scottjehl/Respond](https://github.com/scottjehl/Respond)
- [github.com/keithclark/selectivizr](https://github.com/keithclark/selectivizr)
- [github.com/arv/ExplorerCanvas](https://github.com/arv/ExplorerCanvas)
- [github.com/etianen/html5media](https://github.com/etianen/html5media)
- [github.com/Modernizr/Modernizr](https://github.com/Modernizr/Modernizr)
- Default CSS Framework
- [github.com/jslegers/cascadeframework](https://github.com/jslegers/cascadeframework)
- WYSIWYG HTML Editor
- [github.com/summernote/summernote](https://github.com/summernote/summernote)
- Included libraries
- [jQuery](https://jquery.com/)
- [jQuery UI](https://jqueryui.com/)
- [github.com/kamranahmedse/jquery-toast-plugin](https://github.com/kamranahmedse/jquery-toast-plugin)
- [github.com/hiddentao/squel](https://github.com/hiddentao/squel)
- [github.com/BorisMoore/jsrender](https://github.com/BorisMoore/jsrender)
- [Includes binaries](https://github.com/gnh1201/welsonjs/blob/master/bin/README.MD)
- [module.exports](https://nodejs.org/en/knowledge/getting-started/what-is-require/), CommonJS, UMD compatibility
- [NPM](https://www.npmjs.com/) compatibility
- [gRPC](https://grpc.io/) protocol support (New feature in 2023) [see video demo](https://youtu.be/GqbU5JKuLac)
* Built-in transpilers: [TypeScript](https://www.typescriptlang.org/), [Rescript](https://rescript-lang.org/), [CoffeeScript 2](https://coffeescript.org/), [LiveScript](https://livescript.net/)
* **Ready to use on Windows machine immediately. No additional software installation is required.**
* **WelsonJS Launcher**: Manage instances (Like a container), User-defined variable editor, [Microsoft Monaco Editor](https://github.com/microsoft/monaco-editor) and [React](https://react.dev/) (Pre-embedded rich code editor), [Microsoft Copilot](https://copilot.microsoft.com), and [Azure AI Services](https://azure.microsoft.com/en-us/products/ai-services), Network tools (Whois, DNS Query, [Criminal IP CTI](https://www.criminalip.io/)) on the code editor.
* ES5(ECMAScript 5), XML, JSON, YAML compatibility: [core-js](https://github.com/zloirock/core-js), [JSON2.js](https://github.com/douglascrockford/JSON-js), [js-yaml](https://github.com/nodeca/js-yaml)
* HTML5 compatibility on the built-in HTML rendering engine: [html5shiv](https://github.com/aFarkas/html5shiv), [jquery-html5-placeholder-shim](https://github.com/parndt/jquery-html5-placeholder-shim), [Respond](https://github.com/scottjehl/Respond), [selectivizr](https://github.com/keithclark/selectivizr), [ExplorerCanvas](https://github.com/arv/ExplorerCanvas), [Modernizr](https://github.com/Modernizr/Modernizr)
* Classical CSS Frameworks: [cascadeframework](https://github.com/jslegers/cascadeframework), [golden-layout](https://github.com/golden-layout/golden-layout)
* WYSIWYG HTML Editor: [summernote](https://github.com/summernote/summernote)
* Included libraries: [jQuery](https://jquery.com/), [jQuery UI](https://jqueryui.com/), [jquery-toast-plugin](https://github.com/kamranahmedse/jquery-toast-plugin), [squel](https://github.com/hiddentao/squel), [jsrender](https://github.com/BorisMoore/jsrender), [linq](https://github.com/mihaifm/linq), [pegjs](https://github.com/pegjs/pegjs), [numbers.js](https://github.com/numbers/numbers.js)
* Compatible with modern JavaScript specifications: [module.exports](https://nodejs.org/api/modules.html#moduleexports), CommonJS, UMD compatibility, [NPM(Node Package Manager)](https://www.npmjs.com/) compatibility
* Support a device debugging protocol clients: [Chrome DevTools Protocol](https://chromedevtools.github.io/devtools-protocol/), [ADB(Android Debug Bridge)](https://source.android.com/docs/setup/build/adb)
* RPC(Remote Procedure Call) protocol clients: [gRPC](https://grpc.io/), [JSON-RPC 2.0](https://www.jsonrpc.org/specification)
* Various types of HTTP clients: [XHR(MSXML)](https://developer.mozilla.org/docs/Glossary/XMLHttpRequest), [cURL](https://curl.se/), [BITS](https://en.m.wikipedia.org/w/index.php?title=Background_Intelligent_Transfer_Service), [CERT](https://github.com/MicrosoftDocs/windowsserverdocs/blob/main/WindowsServerDocs/administration/windows-commands/certutil.md), Web Proxy, SEO/SERP
* The native toolkit for Windows environments: Write a Windows Service Application with JavaScript, Control a window handle, Cryptography (e.g., [ISO/IEC 18033-3:2010](https://www.iso.org/standard/54531.html) aka. [HIGHT](https://seed.kisa.or.kr/kisa/algorithm/EgovHightInfo.do)), [Named Shared Memory](https://learn.microsoft.com/en-us/windows/win32/memory/creating-named-shared-memory) based [IPC](https://qiita.com/gnh1201/items/4e70dccdb7adacf0ace5), [NuGet package](https://www.nuget.org/packages/WelsonJS.Toolkit)
* AI integrations: LLM-based (generative) AI services (e.g., ChatGPT, Google Gemini).
* Aviation Data integrations: [AviationStack](https://aviationstack.com?utm_source=FirstPromoter&utm_medium=Affiliate&fpr=namhyeon71), [SerpApi Google Flights API](https://serpapi.com/google-flights-api?utm_source=welsonjs)
* OVFTool (VMware) integration: [OVFTool for Broadcom/VMware infrastructures](https://developer.broadcom.com/tools/open-virtualization-format-ovf-tool/latest)
* ***:fire: NEW!*** Windows built-in database engine AKA. [ESENT (ESE) database](https://learn.microsoft.com/en-us/windows/win32/extensible-storage-engine/database-overview) interface library (WelsonJS.Esent)
* ***:fire: NEW!*** WelsonJS JCTG(JavaScript-Click-To-Go): Run WelsonJS script files written in JavaScript directly from Windows File Explorer with a (double) click. Just like an `.exe` file.
* Everything you can imagine.
## Included libraries
- lib/std (Standard library)
- lib/system (System interface)
- lib/base64 (BASE64 encode and decode)
- lib/file (File I/O interface)
- lib/http (HTTP interface with MSXML and cURL)
- lib/json (JSON library)
- lib/registry (Windows Registry interface)
- lib/security (Windows Security Policy interface)
- lib/shell (Windows Shell (Command Prompt) interface)
- lib/powershell (Windows Powershell interface)
- lib/service (Windows Service interface)
- lib/oldbrowser (ES5, HTML5/CSS3 compatibility layer)
- lib/uri (URI scheme interface)
- lib/winlibs (Windows DLL(Dynamic-link library) interface)
- lib/autohotkey ([AutoHotkey](https://www.autohotkey.com/) interface)
- lib/autoit ([AutoIt3/AutoItX](https://www.autoitscript.com/) interface)
- lib/msoffice (Microsoft Office (e.g. Excel) interface)
- lib/gtk (GTK/GladeXML server GUI interface)
- lib/chrome (Chrome Web Browser Debugging interface)
- lib/toolkit (`WelsonJS.Toolkit` native component)
- lib/pipe-ipc (PIPE-based IPC(Inter-Process Communication) implementation)
- lib/chatgpt ([ChatGPT](https://openai.com/chatgpt) integration)
- Everything you can imagine.
## Make your own `sayhello` example
## Quick start
### 1. Write a file `lib/sayhello.js`
```js
@ -80,8 +92,8 @@ function say() {
exports.say = say;
exports.VERSIONINFO = "SayHello Library (sayhello.js) version 0.1";
exports.AUTHOR = "abuse@catswords.net"; // e.g. YOUR EMAIL ADDRESS
exports.VERSIONINFO = "SayHello (sayhello.js) version 0.1";
exports.AUTHOR = "gnh1201@catswords.re.kr";
exports.global = global;
exports.require = global.require;
```
@ -100,45 +112,71 @@ function main() {
exports.main = main;
```
### 3. Execute file on the command prompt
### 3. Execute script on the console
```cmd
C:\Users\oss\Documents\GitHub\welsonjs> cscript app.js sayhello
C:\Users\JohnDoe\Documents\GitHub\welsonjs> cscript app.js sayhello
calling say()
hello
ended say()
```
## How to make your own setup file
- Please check `setup.iss` file it could be compile with [Inno Setup](https://jrsoftware.org/isinfo.php)
## How to release my application?
The WelsonJS framework suggests the following application release methods:
* **Compress to Zip, and use the launcher**: Compress the files and directories necessary for running the project into a Zip file, and distribute it along with the WelsonJS Launcher.
* **Build a setup file**: Use [Inno Setup](https://jrsoftware.org/isinfo.php). The setup profile (the `setup.iss` file) is already included.
* **Copy all directories and files**: This is the simplest and most straightforward method.
## Screenshots
![Screenshot 1](app/assets/img/screenshot.png)
![(Screenshot 1) GUI environment](https://catswords.blob.core.windows.net/welsonjs/images/screenshot.png)
![Screenshot 2](app/assets/img/screenshot2.png)
![(Screenshot 2) Command-line environment](https://catswords.blob.core.windows.net/welsonjs/images/screenshot2.png)
![Screenshot 3](app/assets/img/screenshot3.png)
![(Screenshot 3) WelsonJS with Microsoft Excel](https://catswords.blob.core.windows.net/welsonjs/images/screenshot3.png)
## Thanks!
![Thanks 1](app/assets/img/thanks.png)
![(Screenshot 4) Write a Windows Service with JavaScript](https://catswords.blob.core.windows.net/welsonjs/images/screenshot4.png)
- https://www.facebook.com/javascript4u/posts/1484014618472735
- https://python5.com/q/xtbsqjxb
![(Screenshot 5) Template Matching on the computer screen](https://catswords.blob.core.windows.net/welsonjs/images/screenshot5.png)
## Related projects
- [gnh1201/wsh-js-gtk](https://github.com/gnh1201/wsh-js-gtk) - GTK GUI ported to Windows Scripting Host - Javascript (Microsoft JScript) (wsh-js)
- [gnh1201/wsh-json](https://github.com/gnh1201/wsh-json) - JSON stringify/parse (encode/decode) for Windows Scripting Host
- [redskyit/wsh-appjs](https://github.com/redskyit/wsh-appjs) - require-js and app framework for Windows Scripting Host JavaScript
- [JohnLaTwC's gist](https://gist.github.com/JohnLaTwC/4315bbbd89da0996f5c08c032b391799) - JavaScript RAT
- [JSMan-/JS-Framework](https://github.com/JSMan-/JS-Framework) - No description
- [iconjack/setTimeout-for-windows-script-host](https://github.com/iconjack/setTimeout-for-windows-script-host) - Replacement for the missing setTimeout and clearTimeout function in Windows Script Host
- [johnjohnsp1/WindowsScriptHostExtension](https://github.com/johnjohnsp1/WindowsScriptHostExtension) - Inject DLL Prototype using Microsoft.Windows.ACTCTX COM Object
- [kuntashov/jsunit](https://github.com/kuntashov/jsunit) - JSUnit port for Windows Scripting Host
- [nickdoth/WSHHttpServer](https://github.com/nickdoth/WSHHttpServer) - HTTP server based on Windows Script Host
![(Screenshot 6) The Launcher for WelsonJS Application Packages](https://catswords.blob.core.windows.net/welsonjs/images/screenshot6.png)
## Image stocks
- [7418_blocks_color_modules_rgb_square_icon](https://www.iconfinder.com/icons/7418/blocks_color_modules_rgb_square_icon) (Icon File) - Sergio Sanchesz Lopez, Futurosoft
![(Screenshot 7) Microsoft Monaco Editor on WelsonJS Launcher](https://catswords.blob.core.windows.net/welsonjs/images/screenshot7.png)
## Contact me
- [Paid technical support on Fiverr](https://www.fiverr.com/s/G42xRd)
- abuse@catswords.net
- ActivityPub [@catswords_oss@catswords.social](https://catswords.social/@catswords_oss)
![(Screenshot 8) You can run a .js file just like an executable by simply double-clicking it.](https://catswords.blob.core.windows.net/welsonjs/images/screenshot8.png)
## Thanks to
* :heart: Artwork (Logo image): [@druidesse](https://github.com/druidesse)
* :heart: Artwork (Cover image): [@_bag0@x.com](https://x.com/_bag0)
* :heart: Special Contributors: [@hcho3](https://github.com/hcho3), :octocat: [GitHub Sponsors](https://github.com/sponsors/gnh1201)
* :sunglasses: Heavy-industry specialized CSP(Cloud Service Provider) in Republic of Korea - Use case development
* :sunglasses: Live-commerce specialized online advertisement companies in Republic of Korea - Use case development
* :sunglasses: Information security companies in Republic of Korea - Use case development
* :sunglasses: Travel planning(e.g., Airlines, Hotels, Ticketing) related companies - Use case development
* :sunglasses: Probability-based game prediction in a data analytics company - Use case development
* :sunglasses: Qiita - Knowledge-base about WSH environment
* :sunglasses: Redsky Software - PoC(Proof of Concept) of the CommonJS on WSH environment
* :sunglasses: Inspired by a small-sized JavaScript payload demonstrated by a cybersecurity related group.
* :sunglasses: Inspired by the use of Named Shared Memory in a cross-runtime IPC implementation written by the unidentified developer.
* :eyes: [Hacker News](https://news.ycombinator.com/item?id=41316782), [Node Weekly (#582 - June 17, 2025)](https://nodeweekly.com/issues/582), [WebToolsWeekly](https://webtoolsweekly.com/archives/issue-585/), [GeekNews in GeekNews Weekly (2024-09-30 ~ 2024-10-06)](https://news.hada.io/weekly/202441), [Facebook Group "Javascript Programming"(javascript4u)](https://www.facebook.com/javascript4u/posts/build-a-windows-desktop-apps-with-javascript-html-and-cssmorioh-javascript-html-/1484014618472735/), [morioh.com](https://morioh.com/a/23c427a82bf1/build-a-windows-desktop-apps-with-javascript-html-and-css), CSDN, Fediverse, [daily.dev](https://app.daily.dev/posts/js-libraries-svg-tools-json-databases-8quregz3a), [PitchHut](https://www.pitchhut.com/project/proj_Ya136OLSW5at), [Disquiet](https://dis.qa/nv6T6), [Zhouexin (周e信)](https://www.zhouexin.com/issues/321), [Echo JS](https://www.echojs.com/news/43008), [Telegram Channel @front_end_dev](https://t.me/front_end_dev/9376?ysclid=mgk4a9hqf0853890652)
## Report abuse
* [GitHub Security Advisories (gnh1201/welsonjs)](https://github.com/gnh1201/welsonjs/security)
* [abuse@catswords.net](mailto:abuse@catswords.net)
## Join the community
I am always open. Collaboration, opportunities, and community activities are all welcome.
* ActivityPub [@catswords_oss@catswords.social](https://catswords.social/@catswords_oss)
* XMPP [catswords@conference.omemo.id](xmpp:catswords@conference.omemo.id?join)
* [Join Catswords OSS on Microsoft Teams (teams.live.com)](https://teams.live.com/l/community/FEACHncAhq8ldnojAI)
* [Join Catswords OSS #welsonjs on Discord (discord.gg)](https://discord.gg/XKG5CjtXEj)
## Offline Distribution
You may [request offline distribution](https://forms.gle/4WCnJmnFNDzubUmk7) if you are in a restricted environment, such as one without internet access or with specific security requirements.
## Special channels
* [A paid consultation channel (m.expert.naver.com)](https://m.expert.naver.com/mobile/expert/product/detail?storeId=100051156&productId=100144540) is available for Korean<sup>(한국어)</sup> customers.
* [A paid mentorship program (inflearn.com)](https://mentoring.inflearn.com/mentors/5353) is available for Korean<sup>(한국어)</sup> students or beginners.
## License
[![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgithub.com%2Fgnh1201%2Fwelsonjs.svg?type=large)](https://app.fossa.com/projects/git%2Bgithub.com%2Fgnh1201%2Fwelsonjs?ref=badge_large)

View File

@ -1,20 +0,0 @@
# REGASM for WelsonJS
In general, the location of REGASM is as follows.
```
C:\Windows\Microsoft.NET\Framework\v2.0.50727\RegAsm.exe
```
Or it may vary depending on the version.
## How to register .NET COM/DLL component
Example:
```
C:\Windows\Microsoft.NET\Framework\v2.0.50727\RegAsm.exe /codebase WelsonJS.Toolkit.dll
C:\Windows\Microsoft.NET\Framework64\v2.0.50727\RegAsm.exe /codebase WelsonJS.Toolkit.dll
```
Thank you.

View File

@ -1,18 +1,21 @@
# Security Note for WelsonJS
## Caution
This repository contains information on accessing Windows APIs and functions on the JavaScript runtime, along with recent case studies. While this can provide a flexible development environment for anyone, it can also be misused for malicious purposes. Please be aware that using this project to create abuse tools, such as a DoS attack, may result in legal punishment in your country. We encourage you to use this project only for creating web technology-based applications, like Electron, or legally permitted testing tools.
## License
The WelsonJS project is available under either the GPLv3 or MS-RL opensource licenses. If the GPLv3 license is not compatible with Microsoft products, the MS-RL license applies; otherwise, the GPLv3 license is used. Under these licenses, if you distribute modified versions of this project's source code to third parties, you may be required to disclose the source code. For more details, please refer to the `LICENSE` and `LICENSE_MSRL` files.
## Known use cases
## Caution
This repository contains information on accessing Windows APIs and functions in the JavaScript runtime, along with recent case studies. While this can provide a flexible development environment for anyone, it can also be misused for malicious purposes. Please be aware that using this project to create abuse tools, such as for DoS attacks, may result in legal consequences in your country. We encourage you to use this project only for creating web technology-based applications, like Electron, or legally permitted testing tools.
## Known Use Cases
WelsonJS is typically used for the following purposes:
* Testing web accessibility and compliance, including adherence to W3C standards (WEB-ARIA, WCAG), national laws (ADA/DDA, GDPR), and other relevant regulations.
* Exploring vulnerabilities of equipment within the local network.
* Improving the availability of VPN or Proxy clients.
* Building automation, CD/CI (Continuous Integration/Continuous Delivery), DevOps, and SecOps.
* Asset evaluation (e.g. Get a purchase history from online shopping and delivery websites)
* Improving the availability of VPN or proxy clients.
* Building automation, CI/CD (Continuous Integration/Continuous Delivery), DevOps, and SecOps.
* Asset evaluation (e.g., obtaining purchase history from online shopping and delivery websites).
* Online video streaming quality testing and improvement.
* Office Automation with AI(Artificial Intelligence) services.
* Office automation and integration with LLM-based AI (e.g., ChatGPT) services.
## Notes
1. If you plan to use WelsonJS for a purpose other than those mentioned above, please contact us beforehand.
@ -20,27 +23,46 @@ WelsonJS is typically used for the following purposes:
## Guidelines
### For the use of online shopping and delivery websites
We are aware of cases where WelsonJS has been used for asset valuation to access websites of online shopping or delivery companies. This is a good use case, but there have been reports of website downtime caused by excessive concurrent requests. Please exercise caution and avoid excessive simultaneous executions.
### Use of Online Shopping and Delivery Websites
We are aware of cases where WelsonJS has been used to access the websites of online shopping or delivery companies for asset valuation. This is a good use case, but there have been reports of website downtime caused by excessive concurrent requests. Please exercise caution and avoid excessive simultaneous executions.
### For the use of online video streaming quality testing and improvement
We are aware of cases where WelsonJS is used for the purpose of video streaming quality testing and improvement. It should be used solely for expert-level streaming quality testing, often referred to by terms like 4K, 8K, HD, FHD, UHD, 720p, 1080p, etc. For such purposes, it is recommended to use videos provided by television manufacturers (e.g., LG, Samsung) or graphics card manufacturers (e.g., NVIDIA, AMD) specifically for testing purposes. It is essential to avoid using videos that contain content not legally permitted in the region. The WelsonJS developers and maintainers take no responsibility for the use of videos containing illegal content.
### Use for Online Video Streaming Quality Testing and Improvement
We are aware of cases where WelsonJS is used for video streaming quality testing and improvement. It should be used solely for expert-level streaming quality testing, often referred to by terms like 4K, 8K, HD, FHD, UHD, 720p, 1080p, etc. For such purposes, it is recommended to use videos provided by television manufacturers (e.g., LG, Samsung) or graphics card manufacturers (e.g., NVIDIA, AMD) specifically for testing purposes. It is essential to avoid using videos that contain content not legally permitted in your region. The WelsonJS developers and maintainers take no responsibility for the use of videos containing illegal content.
### For the use of security testing
### Use for Scientific Research Institutes
WelsonJS is designed for flexible industrial facility control (a.k.a. Industrial Scripting) in environments where modifying compiled binaries is restricted. Parts or all of this project's source code may be found in use within scientific research institutes. In such cases, appropriate safety measures tailored to the specific application area may be required. If support is needed for these applications, please do not hesitate to contact us.
### Use for Security Testing
We are aware of instances where WelsonJS has been used by legitimate cybersecurity firms to discover and test vulnerabilities (such as credential stuffing) in IoT devices. If you intend to use WelsonJS as a security testing tool, it should be done in a controlled environment that complies with legal regulations.
### For the use of cloud monitoring
WelsonJS is a project initiated by a cloud service provider in response to a request to develop a lightweight software (e.g., agent) for collecting metrics on Windows systems. While using WelsonJS for this purpose is desirable, ensuring security in the server-client communication is entirely the responsibility of the user.
### Use for Cloud Monitoring
WelsonJS is a project inspired by the requirements of a cloud service provider to develop lightweight software (e.g., agents) for collecting metrics on Windows systems. While using WelsonJS for this purpose is desirable, ensuring security in the server-client communication is entirely the responsibility of the user.
## Alternative names
This program is also known by the following name. This name is used solely for the purpose of identifying the work and does not impact the license:
- "A0562"(2023) (2023 Open-source Development Contest, NIPA National IT Industry Promotion Agency, Republic of Korea)
- "C-2021-000237"(2021) (Copyright Registration Online System, Korea Copyright Commission, Republic of Korea)
- "Codename Macadamia"(2020) (Heavy industry specialized CSP in the Republic of Korea)
## Alternative Names
This program is also known by the following names. These names are used solely for the purpose of identifying the work and do not impact the license:
* DOI [10.5281/zenodo.11382384](https://zenodo.org/doi/10.5281/zenodo.11382384)(2024) (CERN/OpenAIRE Zenodo)
* ["284757291"](https://catswords.blob.core.windows.net/welsonjs/images/1494315-Certificate+SoR-284757291.pdf)(2024) (Registered with the [UK Copyright Service](https://copyrightservice.co.uk/))
* ["A0562"](https://www.oss.kr/dev_competition_activities/show/544723e6-850a-4956-9194-79640420c19a)(2023) (2023 Open-source Development Contest, NIPA National IT Industry Promotion Agency<sup>(정보통신산업진흥원)</sup>, Republic of Korea)
* ["2025-02-08-1952"](https://catswords.blob.core.windows.net/welsonjs/images/20250410092300005.pdf)(2025) (Technical Data Bailment System (Technology Escrow), "Korea Foundation for Cooperation of Large & Small Business, Rural Affairs"<sup>(대·중소기업·농어업협력재단)</sup>, Republic of Korea)
* "C-2021-000237"(2021) (Copyright Registration Online System, Korea Copyright Commission<sup>(한국저작권위원회)</sup>, Republic of Korea)
* "Codename Macadamia"(2020) (Heavy industry specialized CSP in the Republic of Korea)
## We use AI assistance in our development
This project may include code developed with the support of LLM-based AI services, including the paid version of [ChatGPT](https://chatgpt.com/), AI-powered code review tools such as [CodeRabbit](https://www.coderabbit.ai/), [Sourcery](https://sourcery.ai/), and [Qodo](https://www.qodo.ai/), as well as LLM models provided through [Microsoft Azure AI Foundry](https://ai.azure.com/).
## Offline Distribution
You may [request offline distribution](https://forms.gle/4WCnJmnFNDzubUmk7) if you are in a restricted environment, such as one without internet access or with specific security requirements.
## Report abuse
If you discover any instances of this project being misused, please report them.
* [GitHub Security Advisories (gnh1201/welsonjs)](https://github.com/gnh1201/welsonjs/security)
* [abuse@catswords.re.kr](mailto:abuse@catswords.re.kr)
* [Paid technical support on Fiverr](https://www.fiverr.com/s/G42xRd)
* abuse@catswords.net
## Join the community
* ActivityPub [@catswords_oss@catswords.social](https://catswords.social/@catswords_oss)
* XMPP [catswords@conference.omemo.id](xmpp:catswords@conference.omemo.id?join)
* [Join Catswords OSS on Microsoft Teams (teams.live.com)](https://teams.live.com/l/community/FEACHncAhq8ldnojAI)
* [Join Catswords OSS #welsonjs on Discord (discord.gg)](https://discord.gg/XKG5CjtXEj)
## Special channels
* [A paid consultation channel (m.expert.naver.com)](https://m.expert.naver.com/mobile/expert/product/detail?storeId=100051156&productId=100144540) is available for Korean<sup>(한국어)</sup> region.

View File

@ -1,398 +0,0 @@
# Created by https://www.toptal.com/developers/gitignore/api/visualstudio
# Edit at https://www.toptal.com/developers/gitignore?templates=visualstudio
### VisualStudio ###
## Ignore Visual Studio temporary files, build results, and
## files generated by popular Visual Studio add-ons.
##
## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore
# User-specific files
*.rsuser
*.suo
*.user
*.userosscache
*.sln.docstates
# User-specific files (MonoDevelop/Xamarin Studio)
*.userprefs
# Mono auto generated files
mono_crash.*
# Build results
[Dd]ebug/
[Dd]ebugPublic/
[Rr]elease/
[Rr]eleases/
x64/
x86/
[Ww][Ii][Nn]32/
[Aa][Rr][Mm]/
[Aa][Rr][Mm]64/
bld/
[Bb]in/
[Oo]bj/
[Ll]og/
[Ll]ogs/
# Visual Studio 2015/2017 cache/options directory
.vs/
# Uncomment if you have tasks that create the project's static files in wwwroot
#wwwroot/
# Visual Studio 2017 auto generated files
Generated\ Files/
# MSTest test Results
[Tt]est[Rr]esult*/
[Bb]uild[Ll]og.*
# NUnit
*.VisualState.xml
TestResult.xml
nunit-*.xml
# Build Results of an ATL Project
[Dd]ebugPS/
[Rr]eleasePS/
dlldata.c
# Benchmark Results
BenchmarkDotNet.Artifacts/
# .NET Core
project.lock.json
project.fragment.lock.json
artifacts/
# ASP.NET Scaffolding
ScaffoldingReadMe.txt
# StyleCop
StyleCopReport.xml
# Files built by Visual Studio
*_i.c
*_p.c
*_h.h
*.ilk
*.meta
*.obj
*.iobj
*.pch
*.pdb
*.ipdb
*.pgc
*.pgd
*.rsp
*.sbr
*.tlb
*.tli
*.tlh
*.tmp
*.tmp_proj
*_wpftmp.csproj
*.log
*.tlog
*.vspscc
*.vssscc
.builds
*.pidb
*.svclog
*.scc
# Chutzpah Test files
_Chutzpah*
# Visual C++ cache files
ipch/
*.aps
*.ncb
*.opendb
*.opensdf
*.sdf
*.cachefile
*.VC.db
*.VC.VC.opendb
# Visual Studio profiler
*.psess
*.vsp
*.vspx
*.sap
# Visual Studio Trace Files
*.e2e
# TFS 2012 Local Workspace
$tf/
# Guidance Automation Toolkit
*.gpState
# ReSharper is a .NET coding add-in
_ReSharper*/
*.[Rr]e[Ss]harper
*.DotSettings.user
# TeamCity is a build add-in
_TeamCity*
# DotCover is a Code Coverage Tool
*.dotCover
# AxoCover is a Code Coverage Tool
.axoCover/*
!.axoCover/settings.json
# Coverlet is a free, cross platform Code Coverage Tool
coverage*.json
coverage*.xml
coverage*.info
# Visual Studio code coverage results
*.coverage
*.coveragexml
# NCrunch
_NCrunch_*
.*crunch*.local.xml
nCrunchTemp_*
# MightyMoose
*.mm.*
AutoTest.Net/
# Web workbench (sass)
.sass-cache/
# Installshield output folder
[Ee]xpress/
# DocProject is a documentation generator add-in
DocProject/buildhelp/
DocProject/Help/*.HxT
DocProject/Help/*.HxC
DocProject/Help/*.hhc
DocProject/Help/*.hhk
DocProject/Help/*.hhp
DocProject/Help/Html2
DocProject/Help/html
# Click-Once directory
publish/
# Publish Web Output
*.[Pp]ublish.xml
*.azurePubxml
# Note: Comment the next line if you want to checkin your web deploy settings,
# but database connection strings (with potential passwords) will be unencrypted
*.pubxml
*.publishproj
# Microsoft Azure Web App publish settings. Comment the next line if you want to
# checkin your Azure Web App publish settings, but sensitive information contained
# in these scripts will be unencrypted
PublishScripts/
# NuGet Packages
*.nupkg
# NuGet Symbol Packages
*.snupkg
# The packages folder can be ignored because of Package Restore
**/[Pp]ackages/*
# except build/, which is used as an MSBuild target.
!**/[Pp]ackages/build/
# Uncomment if necessary however generally it will be regenerated when needed
#!**/[Pp]ackages/repositories.config
# NuGet v3's project.json files produces more ignorable files
*.nuget.props
*.nuget.targets
# Nuget personal access tokens and Credentials
nuget.config
# Microsoft Azure Build Output
csx/
*.build.csdef
# Microsoft Azure Emulator
ecf/
rcf/
# Windows Store app package directories and files
AppPackages/
BundleArtifacts/
Package.StoreAssociation.xml
_pkginfo.txt
*.appx
*.appxbundle
*.appxupload
# Visual Studio cache files
# files ending in .cache can be ignored
*.[Cc]ache
# but keep track of directories ending in .cache
!?*.[Cc]ache/
# Others
ClientBin/
~$*
*~
*.dbmdl
*.dbproj.schemaview
*.jfm
*.pfx
*.publishsettings
orleans.codegen.cs
# Including strong name files can present a security risk
# (https://github.com/github/gitignore/pull/2483#issue-259490424)
#*.snk
# Since there are multiple workflows, uncomment next line to ignore bower_components
# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)
#bower_components/
# RIA/Silverlight projects
Generated_Code/
# Backup & report files from converting an old project file
# to a newer Visual Studio version. Backup files are not needed,
# because we have git ;-)
_UpgradeReport_Files/
Backup*/
UpgradeLog*.XML
UpgradeLog*.htm
ServiceFabricBackup/
*.rptproj.bak
# SQL Server files
*.mdf
*.ldf
*.ndf
# Business Intelligence projects
*.rdl.data
*.bim.layout
*.bim_*.settings
*.rptproj.rsuser
*- [Bb]ackup.rdl
*- [Bb]ackup ([0-9]).rdl
*- [Bb]ackup ([0-9][0-9]).rdl
# Microsoft Fakes
FakesAssemblies/
# GhostDoc plugin setting file
*.GhostDoc.xml
# Node.js Tools for Visual Studio
.ntvs_analysis.dat
node_modules/
# Visual Studio 6 build log
*.plg
# Visual Studio 6 workspace options file
*.opt
# Visual Studio 6 auto-generated workspace file (contains which files were open etc.)
*.vbw
# Visual Studio LightSwitch build output
**/*.HTMLClient/GeneratedArtifacts
**/*.DesktopClient/GeneratedArtifacts
**/*.DesktopClient/ModelManifest.xml
**/*.Server/GeneratedArtifacts
**/*.Server/ModelManifest.xml
_Pvt_Extensions
# Paket dependency manager
.paket/paket.exe
paket-files/
# FAKE - F# Make
.fake/
# CodeRush personal settings
.cr/personal
# Python Tools for Visual Studio (PTVS)
__pycache__/
*.pyc
# Cake - Uncomment if you are using it
# tools/**
# !tools/packages.config
# Tabs Studio
*.tss
# Telerik's JustMock configuration file
*.jmconfig
# BizTalk build output
*.btp.cs
*.btm.cs
*.odx.cs
*.xsd.cs
# OpenCover UI analysis results
OpenCover/
# Azure Stream Analytics local run output
ASALocalRun/
# MSBuild Binary and Structured Log
*.binlog
# NVidia Nsight GPU debugger configuration file
*.nvuser
# MFractors (Xamarin productivity tool) working folder
.mfractor/
# Local History for Visual Studio
.localhistory/
# BeatPulse healthcheck temp database
healthchecksdb
# Backup folder for Package Reference Convert tool in Visual Studio 2017
MigrationBackup/
# Ionide (cross platform F# VS Code tools) working folder
.ionide/
# Fody - auto-generated XML schema
FodyWeavers.xsd
# VS Code files for those working on multiple tools
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json
*.code-workspace
# Local History for Visual Studio Code
.history/
# Windows Installer files from build outputs
*.cab
*.msi
*.msix
*.msm
*.msp
# JetBrains Rider
.idea/
*.sln.iml
### VisualStudio Patch ###
# Additional files built by Visual Studio
# End of https://www.toptal.com/developers/gitignore/api/visualstudio

View File

@ -0,0 +1,652 @@
// AssemblyLoader.cs (Catswords.Phantomizer)
// SPDX-License-Identifier: MIT
// SPDX-FileCopyrightText: Namhyeon Go <gnh1201@catswords.re.kr>, 2025 Catswords OSS and WelsonJS Contributors
// https://github.com/gnh1201/welsonjs
//
using System.Security.Cryptography;
using System.Text;
using System.Xml.Linq;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.IO.Compression;
using System.Net;
using System.Net.Http;
using System.Reflection;
using System.Runtime.InteropServices;
namespace Catswords.Phantomizer
{
/// <summary>
/// Network-aware loader for managed (.NET) and native (C/C++) binaries.
/// - Managed assemblies resolve via AssemblyResolve
/// - Native modules explicitly loaded via LoadNativeModules(...)
/// - All DLLs must have valid Authenticode signatures
/// - Cached at: %APPDATA%\Catswords\assembly\{Name}\{Version}\
/// - BaseUrl must be set by Main() before calling Register()
/// </summary>
public static class AssemblyLoader
{
/// <summary>
/// Base URL for downloading managed/native binaries.
/// Example: https://catswords.blob.core.windows.net/welsonjs/packages
/// Must be set before Register() or LoadNativeModules().
/// </summary>
public static string BaseUrl { get; set; } = null;
public static string LoaderNamespace { get; set; } = typeof(AssemblyLoader).Namespace;
public static string AppName { get; set; } = "Catswords";
public static string IntegrityUrl { get; set; } = null;
// Hash whitelist (values only)
private static HashSet<string> _integrityHashes = null;
private static bool _integrityLoaded = false;
private static readonly object IntegritySyncRoot = new object();
private static readonly object SyncRoot = new object();
private static bool _registered;
private static readonly HttpClientHandler LegacyHttpHandler = new HttpClientHandler
{
AutomaticDecompression = DecompressionMethods.None
};
private static readonly HttpClientHandler HttpHandler = new HttpClientHandler
{
AutomaticDecompression = DecompressionMethods.GZip | DecompressionMethods.Deflate
};
private static readonly HttpClient LegacyHttp = CreateClient(LegacyHttpHandler); // Does not send Accept-Encoding (gzip, deflate)
private static readonly HttpClient Http = CreateClient(HttpHandler); // Sends Accept-Encoding (gzip, deflate) and auto-decompresses
private static HttpClient CreateClient(HttpMessageHandler handler)
{
var client = new HttpClient(handler, disposeHandler: false)
{
Timeout = TimeSpan.FromSeconds(300) // 5 minutes
};
return client;
}
// -------------------- kernel32 native loading --------------------
[DllImport("kernel32.dll", SetLastError = true, CharSet = CharSet.Unicode)]
private static extern IntPtr LoadLibrary(string lpFileName);
[DllImport("kernel32.dll", SetLastError = true, CharSet = CharSet.Unicode)]
private static extern bool SetDllDirectory(string lpPathName);
// -------------------- WinVerifyTrust (signature verification) --------------------
private const uint ERROR_SUCCESS = 0x00000000;
private const uint TRUST_E_NOSIGNATURE = 0x800B0100;
//private const uint TRUST_E_EXPLICIT_DISTRUST = 0x800B0111;
//private const uint TRUST_E_SUBJECT_NOT_TRUSTED = 0x800B0004;
//private const uint CRYPT_E_SECURITY_SETTINGS = 0x80092026;
private static readonly Guid WINTRUST_ACTION =
new Guid("00aac56b-cd44-11d0-8cc2-00c04fc295ee");
[DllImport("wintrust.dll", CharSet = CharSet.Unicode)]
private static extern uint WinVerifyTrust(
IntPtr hwnd,
[MarshalAs(UnmanagedType.LPStruct)] Guid pgActionID,
ref WINTRUST_DATA pWVTData);
private enum FileSignatureStatus { Valid, NoSignature, Invalid }
// -------------------- WinTrust Structures --------------------
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
private struct WINTRUST_FILE_INFO
{
public uint cbStruct;
[MarshalAs(UnmanagedType.LPWStr)] public string pcwszFilePath;
public IntPtr hFile;
public IntPtr pgKnownSubject;
public WINTRUST_FILE_INFO(string filePath)
{
cbStruct = (uint)Marshal.SizeOf(typeof(WINTRUST_FILE_INFO));
pcwszFilePath = filePath;
hFile = IntPtr.Zero;
pgKnownSubject = IntPtr.Zero;
}
}
private enum WinTrustDataUIChoice : uint { None = 2 }
private enum WinTrustDataRevocationChecks : uint { None = 0 }
private enum WinTrustDataChoice : uint { File = 1 }
private enum WinTrustDataStateAction : uint { Ignore = 0 }
private enum WinTrustDataUIContext : uint { Execute = 0 }
[Flags]
private enum WinTrustDataProvFlags : uint
{
RevocationCheckNone = 0x00000010,
DisableMD2andMD4 = 0x00002000
}
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
private struct WINTRUST_DATA
{
public uint cbStruct;
public IntPtr pPolicyCallbackData;
public IntPtr pSIPClientData;
public WinTrustDataUIChoice dwUIChoice;
public WinTrustDataRevocationChecks dwRevocationChecks;
public WinTrustDataChoice dwUnionChoice;
public IntPtr pFile;
public WinTrustDataStateAction dwStateAction;
public IntPtr hWVTStateData;
public string pwszURLReference;
public WinTrustDataProvFlags dwProvFlags;
public WinTrustDataUIContext dwUIContext;
public WINTRUST_DATA(IntPtr pFileInfo)
{
cbStruct = (uint)Marshal.SizeOf(typeof(WINTRUST_DATA));
pPolicyCallbackData = IntPtr.Zero;
pSIPClientData = IntPtr.Zero;
dwUIChoice = WinTrustDataUIChoice.None;
dwRevocationChecks = WinTrustDataRevocationChecks.None;
dwUnionChoice = WinTrustDataChoice.File;
pFile = pFileInfo;
dwStateAction = WinTrustDataStateAction.Ignore;
hWVTStateData = IntPtr.Zero;
pwszURLReference = null;
dwProvFlags = WinTrustDataProvFlags.RevocationCheckNone |
WinTrustDataProvFlags.DisableMD2andMD4;
dwUIContext = WinTrustDataUIContext.Execute;
}
}
// ========================================================================
// PUBLIC API
// ========================================================================
/// <summary>
/// Registers AssemblyResolve to download and validate .NET assemblies.
/// </summary>
public static void Register()
{
lock (SyncRoot)
{
if (_registered)
return;
try
{
if (!_integrityLoaded)
LoadIntegrityManifest();
if (string.IsNullOrWhiteSpace(BaseUrl))
throw new InvalidOperationException("BaseUrl must be configured before Register().");
if (Uri.TryCreate(BaseUrl, UriKind.Absolute, out Uri uri))
{
if (uri.Scheme != Uri.UriSchemeHttps)
throw new InvalidOperationException("BaseUrl must use HTTPS for security.");
}
else
{
throw new InvalidOperationException("BaseUrl is not a valid absolute URI.");
}
}
catch (Exception ex)
{
Trace.TraceError("AssemblyLoader: failed to initialize: {0}", ex.Message);
throw;
}
AppDomain.CurrentDomain.AssemblyResolve += OnAssemblyResolve;
_registered = true;
Trace.TraceInformation("AssemblyLoader: AssemblyResolve handler registered.");
}
}
/// <summary>
/// Loads native modules associated with an assembly (explicit).
/// </summary>
public static void LoadNativeModules(string ownerAssemblyName, Version version, IList<string> fileNames)
{
if (string.IsNullOrWhiteSpace(BaseUrl))
throw new InvalidOperationException("AssemblyLoader.BaseUrl must be set before loading native modules.");
if (ownerAssemblyName == null) throw new ArgumentNullException("ownerAssemblyName");
if (version == null) throw new ArgumentNullException("version");
if (fileNames == null) throw new ArgumentNullException("fileNames");
string versionString = version.ToString();
lock (SyncRoot)
{
string appData = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData);
string cacheDir = Path.Combine(appData, AppName, "assembly", ownerAssemblyName, versionString);
Directory.CreateDirectory(cacheDir);
try
{
if (!SetDllDirectory(cacheDir))
Trace.TraceWarning("SetDllDirectory failed for: {0}", cacheDir);
}
catch (Exception ex)
{
Trace.TraceWarning("SetDllDirectory threw exception: {0}", ex.Message);
}
foreach (string raw in fileNames)
{
if (string.IsNullOrWhiteSpace(raw))
continue;
string fileName = raw.Trim();
string localPath = Path.Combine(cacheDir, fileName);
if (!File.Exists(localPath))
{
string url = $"{BaseUrl.TrimEnd('/')}/native/{ownerAssemblyName}/{versionString}/{fileName}";
DownloadFile(url, localPath);
Trace.TraceInformation("Downloaded native module: {0}", fileName);
}
else
{
Trace.TraceInformation("Using cached native module: {0}", localPath);
}
EnsureIntegrityOrThrow(localPath);
EnsureSignedFileOrThrow(localPath, fileName);
IntPtr h = LoadLibrary(localPath);
if (h == IntPtr.Zero)
{
int errorCode = Marshal.GetLastWin32Error();
Trace.TraceError("LoadLibrary failed for {0} with error code {1}", localPath, errorCode);
throw new InvalidOperationException($"Failed to load native module: {fileName} (error: {errorCode})");
}
else
{
Trace.TraceInformation("Loaded native module: {0}", fileName);
}
}
}
}
public static void LoadNativeModules(Assembly asm, IList<string> fileNames)
{
if (asm == null)
throw new ArgumentNullException(nameof(asm));
if (fileNames == null)
throw new ArgumentNullException(nameof(fileNames));
AssemblyName an = asm.GetName();
if (an == null)
throw new InvalidOperationException("Assembly.GetName() returned null.");
if (an.Name == null || an.Version == null)
throw new InvalidOperationException("Assembly name or version is missing.");
LoadNativeModules(an.Name, an.Version, fileNames);
}
// ========================================================================
// ASSEMBLY RESOLVE HANDLER (MANAGED)
// ========================================================================
private static Assembly OnAssemblyResolve(object sender, ResolveEventArgs args)
{
Trace.TraceInformation("AssemblyResolve: {0}", args.Name);
AssemblyName req = new AssemblyName(args.Name);
string simpleName = req.Name;
if (IsFrameworkAssembly(simpleName))
return null;
var entry = Assembly.GetEntryAssembly();
if (entry != null)
{
var entryName = entry.GetName().Name;
if (string.Equals(simpleName, entryName, StringComparison.OrdinalIgnoreCase))
{
Trace.TraceInformation("AssemblyResolve: skipping entry assembly {0}", simpleName);
return null;
}
}
Version version = req.Version ?? new Version(0, 0, 0, 0);
string versionStr = version.ToString();
lock (SyncRoot)
{
string appData = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData);
string cacheDir = Path.Combine(appData, AppName, "assembly", simpleName, versionStr);
string dllPath = Path.Combine(cacheDir, simpleName + ".dll");
Directory.CreateDirectory(cacheDir);
if (!File.Exists(dllPath))
{
string url = $"{BaseUrl.TrimEnd('/')}/managed/{simpleName}/{versionStr}/{simpleName}.dll";
DownloadFile(url, dllPath);
Trace.TraceInformation("Downloaded managed assembly: {0}", simpleName);
}
else
{
Trace.TraceInformation("Using cached managed assembly: {0}", dllPath);
}
if (!File.Exists(dllPath))
{
Trace.TraceWarning("AssemblyResolve: managed assembly not found after download attempt: {0}", simpleName);
return null;
}
EnsureIntegrityOrThrow(dllPath);
EnsureSignedFileOrThrow(dllPath, simpleName);
return Assembly.LoadFrom(dllPath);
}
}
// ========================================================================
// HELPERS
// ========================================================================
private static void DownloadFile(string url, string dest)
{
HttpResponseMessage res = null;
try
{
string gzUrl = url + ".gz";
bool isDll = url.EndsWith(".dll", StringComparison.OrdinalIgnoreCase); // *.dll.gz
bool downloaded = false;
if (isDll && TryDownloadCompressedFile(gzUrl, dest))
{
Trace.TraceInformation("Downloaded and decompressed file to: {0}", dest);
downloaded = true;
}
if (!downloaded)
{
Trace.TraceInformation("Downloading file from: {0}", url);
res = Http.GetAsync(url).GetAwaiter().GetResult();
res.EnsureSuccessStatusCode();
using (Stream s = res.Content.ReadAsStreamAsync().GetAwaiter().GetResult())
using (var fs = new FileStream(dest, FileMode.Create, FileAccess.Write))
{
s.CopyTo(fs);
}
Trace.TraceInformation("Downloaded file to: {0}", dest);
}
if (!File.Exists(dest))
{
throw new FileNotFoundException("File not found after download", dest);
}
}
catch (HttpRequestException ex)
{
Trace.TraceError("Network or I/O error downloading {0}: {1}", url, ex.Message);
throw;
}
catch (Exception ex)
{
Trace.TraceError("Unexpected error downloading {0}: {1}", url, ex.Message);
throw;
}
finally
{
res?.Dispose();
}
}
private static bool TryDownloadCompressedFile(string gzUrl, string dest)
{
string tempFile = dest + ".tmp";
try
{
using (var res = LegacyHttp.GetAsync(gzUrl).GetAwaiter().GetResult())
{
if (res.StatusCode == HttpStatusCode.NotFound)
{
Trace.TraceInformation("No gzipped variant at {0}; falling back to uncompressed URL.", gzUrl);
return false;
}
res.EnsureSuccessStatusCode();
using (Stream s = res.Content.ReadAsStreamAsync().GetAwaiter().GetResult())
using (var gz = new GZipStream(s, CompressionMode.Decompress))
using (var fs = new FileStream(tempFile, FileMode.Create, FileAccess.Write))
{
gz.CopyTo(fs);
}
if (File.Exists(dest))
File.Delete(dest);
File.Move(tempFile, dest);
return true;
}
}
catch (HttpRequestException ex)
{
Trace.TraceWarning("Network or I/O error downloading compressed file from {0}: {1}", gzUrl, ex.Message);
throw;
}
catch (Exception ex)
{
Trace.TraceError("Unexpected error downloading compressed file from {0}: {1}", gzUrl, ex.Message);
throw;
}
finally
{
if (File.Exists(tempFile))
{
try
{
File.Delete(tempFile);
}
catch (Exception ex)
{
Trace.TraceInformation("Failed to delete temporary file {0}: {1}", tempFile, ex.Message);
}
}
}
}
private static bool IsFrameworkAssembly(string name)
{
return name.StartsWith("System.", StringComparison.OrdinalIgnoreCase) ||
name.StartsWith("Microsoft.", StringComparison.OrdinalIgnoreCase) ||
name == "mscorlib" ||
name == "netstandard" ||
name == "WindowsBase" ||
name == "PresentationCore" ||
name == "PresentationFramework" ||
name.StartsWith($"{LoaderNamespace}.", StringComparison.OrdinalIgnoreCase);
}
private static void LoadIntegrityManifest()
{
lock (IntegritySyncRoot)
{
if (_integrityLoaded)
return;
_integrityHashes = new HashSet<string>(StringComparer.OrdinalIgnoreCase);
if (string.IsNullOrWhiteSpace(IntegrityUrl))
{
_integrityLoaded = true;
return; // integrity disabled
}
XDocument doc;
try
{
if (Uri.TryCreate(IntegrityUrl, UriKind.Absolute, out Uri uri))
{
if (uri.Scheme != Uri.UriSchemeHttps)
throw new InvalidOperationException("IntegrityUrl must use HTTPS for security.");
using (var res = Http.GetAsync(uri).GetAwaiter().GetResult())
{
res.EnsureSuccessStatusCode();
using (var stream = res.Content.ReadAsStreamAsync().GetAwaiter().GetResult())
{
doc = XDocument.Load(stream);
}
}
}
else
{
throw new InvalidOperationException("IntegrityUrl is not a valid absolute URI.");
}
}
catch (Exception ex)
{
Trace.TraceError("AssemblyIntegrity: failed to load manifest: {0}", ex.Message);
throw new InvalidOperationException("Failed to load AssemblyIntegrity manifest.", ex);
}
XElement hashes = doc.Root?.Element("Hashes");
if (hashes == null)
{
Trace.TraceWarning("AssemblyIntegrity: <Hashes> not found. Integrity disabled.");
_integrityLoaded = true;
return;
}
foreach (var h in hashes.Elements("Hash"))
{
var algorithm = h.Attribute("algorithm")?.Value?.Trim();
if (!string.Equals(algorithm, "SHA256", StringComparison.OrdinalIgnoreCase))
continue; // only SHA256 supported
string val = h.Attribute("value")?.Value?.Trim();
if (string.IsNullOrWhiteSpace(val))
continue;
_integrityHashes.Add(val);
}
_integrityLoaded = true;
Trace.TraceInformation("AssemblyIntegrity: loaded {0} allowed hashes.", _integrityHashes.Count);
}
}
private static void EnsureSignedFileOrThrow(string path, string logicalName)
{
if (!File.Exists(path))
{
Trace.TraceError("File does not exist for signature verification: {0}", logicalName);
throw new FileNotFoundException("File not found for signature verification: " + logicalName, path);
}
FileSignatureStatus status = VerifySignature(path);
if (status == FileSignatureStatus.Valid)
{
Trace.TraceInformation("Signature OK: {0}", logicalName);
return;
}
if (status == FileSignatureStatus.NoSignature)
{
Trace.TraceError("BLOCKED unsigned binary: {0}", logicalName);
throw new InvalidOperationException("Unsigned binary blocked: " + logicalName);
}
Trace.TraceError("BLOCKED invalid signature: {0}", logicalName);
throw new InvalidOperationException("Invalid signature: " + logicalName);
}
private static void EnsureIntegrityOrThrow(string path)
{
if (string.IsNullOrWhiteSpace(IntegrityUrl))
return; // disabled
if (_integrityHashes == null || _integrityHashes.Count == 0)
{
Trace.TraceWarning("AssemblyIntegrity: no hashes loaded → skipping check.");
return;
}
byte[] bytes = File.ReadAllBytes(path);
// Compute hashes
string sha256 = ComputeHashHex(bytes, SHA256.Create());
// Check match
if (_integrityHashes.Contains(sha256))
{
Trace.TraceInformation("AssemblyIntegrity: hash OK for {0}", Path.GetFileName(path));
return;
}
Trace.TraceError("AssemblyIntegrity: hash mismatch! SHA256={0}", sha256);
// Delete corrupted file so the next run can re-download a clean copy.
if (File.Exists(path))
{
try
{
File.Delete(path);
Trace.TraceInformation("AssemblyIntegrity: deleted corrupted file {0}", path);
}
catch (Exception ex)
{
Trace.TraceWarning("AssemblyIntegrity: failed to delete corrupted file {0}: {1}", path, ex.Message);
}
}
throw new InvalidOperationException("AssemblyIntegrity check failed for: " + path);
}
private static FileSignatureStatus VerifySignature(string file)
{
WINTRUST_FILE_INFO fileInfo = new WINTRUST_FILE_INFO(file);
IntPtr pFile = Marshal.AllocCoTaskMem(Marshal.SizeOf(typeof(WINTRUST_FILE_INFO)));
Marshal.StructureToPtr(fileInfo, pFile, false);
WINTRUST_DATA data = new WINTRUST_DATA(pFile);
uint result = WinVerifyTrust(IntPtr.Zero, WINTRUST_ACTION, ref data);
Marshal.FreeCoTaskMem(pFile);
if (result == ERROR_SUCCESS) return FileSignatureStatus.Valid;
if (result == TRUST_E_NOSIGNATURE) return FileSignatureStatus.NoSignature;
return FileSignatureStatus.Invalid;
}
private static string ComputeHashHex(byte[] data, HashAlgorithm algorithm)
{
using (algorithm)
{
var hash = algorithm.ComputeHash(data);
var sb = new StringBuilder(hash.Length * 2);
foreach (var b in hash)
sb.Append(b.ToString("x2"));
return sb.ToString();
}
}
}
}

View File

@ -0,0 +1,16 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<Company>Catswords Research</Company>
<Authors>Namhyeon Go, 2025 Catswords OSS and WelsonJS Contributors</Authors>
<PackageProjectUrl>https://github.com/gnh1201/welsonjs</PackageProjectUrl>
<RepositoryType>git</RepositoryType>
<RepositoryUrl>https://github.com/gnh1201/welsonjs</RepositoryUrl>
<PackageTags>loader</PackageTags>
<Description>Catswords.Phantomizer is an HTTP-based dynamic-link library (DLL) loader designed for .NET applications. It allows your application to fetch and load assemblies directly from your CDN (Azure Blob, S3, Cloudflare R2, etc.) at runtime, with optional GZip compression support.</Description>
<Copyright>Namhyeon Go, 2025 Catswords OSS and WelsonJS Contributors</Copyright>
<Version>1.0.0.1</Version>
</PropertyGroup>
</Project>

View File

@ -0,0 +1,21 @@
MIT License
Copyright (c) Namhyeon Go <gnh1201@catswords.re.kr>, 2025 Catswords OSS and WelsonJS Contributors
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

View File

@ -0,0 +1,195 @@
# Catswords.Phantomizer
**Catswords.Phantomizer** is an HTTP-based dynamic-link library (DLL) loader designed for .NET applications.
It allows your application to fetch and load assemblies directly from your CDN (Azure Blob, S3, Cloudflare R2, etc.) at runtime, with optional GZip compression support.
![Catswords.Phantomizer Structure Overview](https://catswords.blob.core.windows.net/welsonjs/images/phantomizer_cover.png)
---
## 🚀 Features
* Load managed (`*.dll`) and native (`*.dll`) assemblies over **HTTPS only**
* Optional `.dll.gz` decompression for faster network delivery
* CDN-friendly URL structure
* Easy bootstrap through a small embedded loader
* Loader is implemented using **pure .NET BCL only** without external dependencies (.NET Fx/Core fully supported)
* Built-in **code-signing verification** support to ensure assemblies are trusted and tamper-free
* An efficient integrity verification process based on an integrity manifest (NFT-grade immutability)
---
## 📦 How to Use
### 1. Embed Phantomizer into your project
You can include **Catswords.Phantomizer** in your project using one of the following methods:
| Method | Description | When to Use | Setup Steps |
|-------|-------------|--------------|-------------|
| **Resources.resx Embedded File** | Stores `Catswords.Phantomizer.dll.gz` inside `Resources.resx` and loads it at runtime. | Recommended when you want the loader fully self-contained inside your executable. | Add file to `Resources.resx` → Access via `Properties.Resources.Phantomizer`. |
| **Embedded Resource** | Embeds `Catswords.Phantomizer.dll.gz` directly into the assembly manifest (outside of `resx`). | Useful when you prefer not to maintain `.resx` files but still want Phantomizer embedded. | Add file to project → Set *Build Action* = `Embedded Resource` → Load via `GetManifestResourceStream()`. |
| **Normal Assembly Reference (no embedding)** | References `Catswords.Phantomizer.dll` normally through project references. | Use this when you distribute Phantomizer as a standalone DLL instead of embedding it. | Add Phantomizer DLL to your project references → `using Catswords.Phantomizer;`. |
---
### 2. Initialize Phantomizer at application startup
Place the following code inside your `Main` method, static constructor, or any early entry point:
```csharp
static Program() {
InitializeAssemblyLoader();
}
private static void InitializeAssemblyLoader()
{
/*
// Example for Embedded Resource:
var asm = Assembly.GetExecutingAssembly();
using (var stream = asm.GetManifestResourceStream(typeof(Program).Namespace + ".Resources.Catswords.Phantomizer.dll.gz"))
{
// decompress and load...
}
*/
byte[] gzBytes = Properties.Resources.Phantomizer;
byte[] dllBytes;
using (var input = new MemoryStream(gzBytes))
using (var gz = new GZipStream(input, CompressionMode.Decompress))
using (var output = new MemoryStream())
{
gz.CopyTo(output);
dllBytes = output.ToArray();
}
Assembly phantomAsm = Assembly.Load(dllBytes);
Type loaderType = phantomAsm.GetType("Catswords.Phantomizer.AssemblyLoader", true);
loaderType.GetProperty("BaseUrl")?.SetValue(null, GetAppConfig("AssemblyBaseUrl")); // Set the CDN base URL
//loaderType.GetProperty("IntegrityUrl")?.SetValue(null, GetAppConfig("IntegrityUrl")); // (Optional) Set the integrity URL
loaderType.GetProperty("LoaderNamespace")?.SetValue(null, typeof(Program).Namespace);
loaderType.GetProperty("AppName")?.SetValue(null, "WelsonJS"); // Application name
loaderType.GetMethod("Register")?.Invoke(null, null);
var loadNativeModulesMethod = loaderType.GetMethod(
"LoadNativeModules",
BindingFlags.Public | BindingFlags.Static,
binder: null,
types: new[] { typeof(string), typeof(Version), typeof(string[]) },
modifiers: null
);
if (loadNativeModulesMethod == null)
throw new InvalidOperationException("LoadNativeModules(string, Version, string[]) method not found.");
loadNativeModulesMethod.Invoke(null, new object[]
{
"ChakraCore",
new Version(1, 13, 0, 0),
new[] { "ChakraCore.dll" }
});
}
```
If embedding is not required, you can reference Phantomizer directly:
```csharp
using Catswords.Phantomizer;
static void Main(string[] args)
{
AssemblyLoader.BaseUrl = GetAppConfig("AssemblyBaseUrl"); // Configure CDN base URL
//AssemblyLoader.IntegrityUrl = GetAppConfig("AssemblyIntegrityUrl"); // (Optional) Set the integrity URL
AssemblyLoader.LoaderNamespace = typeof(Program).Namespace;
AssemblyLoader.AppName = "WelsonJS";
AssemblyLoader.Register();
AssemblyLoader.LoadNativeModules(
"ChakraCore",
new Version(1, 13, 0, 0),
new[] { "ChakraCore.dll" }
);
}
```
---
### 3. Upload your DLL files to a CDN
Upload your managed and native assemblies to your CDN following the URL pattern below.
#### 📁 URL Rules
| Type | Example URL | Description |
| ------------------ | ----------------------------------------------------------------------------------- | ------------------------------- |
| Managed DLL | `https://example.cdn.tld/packages/managed/MyManagedLib/1.0.0.0/MyManagedLib.dll` | Normal .NET assembly |
| Managed DLL (GZip) | `https://example.cdn.tld/packages/managed/MyManagedLib/1.0.0.0/MyManagedLib.dll.gz` | GZip-compressed .NET assembly |
| Native DLL | `https://example.cdn.tld/packages/native/MyNativeLib/1.0.0.0/MyNativeLib.dll` | Native assembly |
| Native DLL (GZip) | `https://example.cdn.tld/packages/native/MyNativeLib/1.0.0.0/MyNativeLib.dll.gz` | GZip-compressed native assembly |
---
### 4. 🎉 Start loading assemblies over HTTP
Once Phantomizer is initialized, your application will automatically fetch missing assemblies from your CDN.
---
## 🛡 Integrity Manifest (Integrity URL)
Phantomizer can verify assemblies before loading them by downloading an integrity manifest (XML).
You can host this integrity file anywhere — **preferably separate from your main CDN**, to prevent tampering and ensure independent verification of assembly integrity.
### 🔒 Why separate Integrity URL and main CDN?
Separating them prevents a compromised CDN bucket from serving malicious DLLs **and falsifying the integrity file**. Phantomizer can **trust the integrity manifest**, even if the main CDN is partially compromised.
### ✔ Recommended: Filebase (IPFS-pinning, NFT-grade immutability)
Filebase provides **immutable IPFS-based storage**, which is widely used in blockchain ecosystems — including **NFT metadata storage** — due to its strong guarantees of *content-addressing* and *tamper resistance*.
Once uploaded and pinned, the file cannot be silently modified without changing its IPFS hash (CID), making it ideal for hosting integrity manifests.
👉 **Recommended signup (with pinning support):** [Filebase](https://console.filebase.com/signup?ref=d44f5cc9cff7)
### ✔ Integrity Manifest Example (from `integrity.xml`)
```xml
<AssemblyIntegrity schemaVersion="1" generatedAt="2025-12-10T00:00:00Z">
<Hashes>
<Hash
value="5e274b47fc60c74159b4d1e21e70c0edf8e0936bdabc46b632525d09ca2fbae8"
algorithm="SHA256"
assemblyName="ChakraCore"
assemblyType="native"
version="1.13.0.0"
platform="x86"
compression="none"
fileName="ChakraCore.dll" />
<!-- ... more entries ... -->
</Hashes>
</AssemblyIntegrity>
```
---
## 📥 Download the pre-compiled file
* [Download Catswords.Phantomizer.dll.gz (catswords.blob.core.windows.net)](https://catswords.blob.core.windows.net/welsonjs/packages/managed/Catswords.Phantomizer/1.0.0.1/Catswords.Phantomizer.dll.gz)
---
## Report abuse
* [GitHub Security Advisories (gnh1201/welsonjs)](https://github.com/gnh1201/welsonjs/security)
* [abuse@catswords.re.kr](mailto:abuse@catswords.re.kr)
## Join the community
I am always open. Collaboration, opportunities, and community activities are all welcome.
* ActivityPub [@catswords_oss@catswords.social](https://catswords.social/@catswords_oss)
* XMPP [catswords@conference.omemo.id](xmpp:catswords@conference.omemo.id?join)
* [Join Catswords OSS on Microsoft Teams (teams.live.com)](https://teams.live.com/l/community/FEACHncAhq8ldnojAI)
* [Join Catswords OSS #welsonjs on Discord (discord.gg)](https://discord.gg/XKG5CjtXEj)

@ -0,0 +1 @@
Subproject commit 36becec43348f259e8bee08cf2fcd171bfe56f42

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,64 @@
//-----------------------------------------------------------------------
// <copyright file="ApiConstants.cs" company="Microsoft Corporation">
// Copyright (c) Microsoft Corporation.
// </copyright>
//-----------------------------------------------------------------------
namespace Microsoft.Isam.Esent.Interop
{
/// <summary>
/// Constants for the ESENT API. These don't have to be looked up via
/// system parameters.
/// </summary>
public static partial class SystemParameters
{
/// <summary>
/// The length of the prefix used to name files used by the database
/// engine.
/// </summary>
public const int BaseNameLength = 3;
/// <summary>
/// Maximum size of a table/column/index name.
/// </summary>
public const int NameMost = 64;
/// <summary>
/// Maximum size for columns which are not JET_coltyp.LongBinary
/// or JET_coltyp.LongText.
/// </summary>
public const int ColumnMost = 255;
/// <summary>
/// Maximum number of columns allowed in a table.
/// </summary>
public const int ColumnsMost = 65248;
/// <summary>
/// Maximum number of fixed columns allowed in a table.
/// </summary>
public const int ColumnsFixedMost = 127;
/// <summary>
/// Maximum number of variable-length columns allowed
/// in a table.
/// </summary>
public const int ColumnsVarMost = 128;
/// <summary>
/// Maximum number of tagged columns allowed in a table.
/// </summary>
public const int ColumnsTaggedMost = 64993;
/// <summary>
/// The number of pages that gives the smallest possible
/// temporary database.
/// </summary>
public const int PageTempDBSmallest = 14;
/// <summary>
/// The maximum length of a locale name (LOCALE_NAME_MAX_LENGTH from winnt.h).
/// </summary>
public const int LocaleNameMaxLength = 85;
}
}

View File

@ -0,0 +1,96 @@
//-----------------------------------------------------------------------
// <copyright file="BoolColumnValue.cs" company="Microsoft Corporation">
// Copyright (c) Microsoft Corporation.
// </copyright>
//-----------------------------------------------------------------------
namespace Microsoft.Isam.Esent.Interop
{
using System;
using System.Diagnostics;
/// <summary>
/// A <see cref="bool"/> column value.
/// </summary>
public class BoolColumnValue : ColumnValueOfStruct<bool>
{
/// <summary>
/// A boxed true value that can be used by ValueAsObject.
/// </summary>
private static readonly object BoxedTrue = true;
/// <summary>
/// A boxed false value that can be used by ValueAsObject.
/// </summary>
private static readonly object BoxedFalse = false;
/// <summary>
/// Gets the last set or retrieved value of the column. The
/// value is returned as a generic object.
/// </summary>
public override object ValueAsObject
{
get
{
if (!this.Value.HasValue)
{
return null;
}
return this.Value.Value ? BoxedTrue : BoxedFalse;
}
}
/// <summary>
/// Gets the size of the value in the column. This returns 0 for
/// variable sized columns (i.e. binary and string).
/// </summary>
protected override int Size
{
[DebuggerStepThrough]
get { return sizeof(bool); }
}
/// <summary>
/// Recursive SetColumns method for data pinning. This populates the buffer and
/// calls the inherited SetColumns method.
/// </summary>
/// <param name="sesid">The session to use.</param>
/// <param name="tableid">
/// The table to set the columns in. An update should be prepared.
/// </param>
/// <param name="columnValues">
/// Column values to set.
/// </param>
/// <param name="nativeColumns">
/// Structures to put the pinned data in.
/// </param>
/// <param name="i">Offset of this object in the array.</param>
/// <returns>An error code.</returns>
internal override unsafe int SetColumns(JET_SESID sesid, JET_TABLEID tableid, ColumnValue[] columnValues, NATIVE_SETCOLUMN* nativeColumns, int i)
{
byte data = this.Value.GetValueOrDefault() ? (byte)0xFF : (byte)0x00;
return this.SetColumns(sesid, tableid, columnValues, nativeColumns, i, &data, sizeof(byte), this.Value.HasValue);
}
/// <summary>
/// Given data retrieved from ESENT, decode the data and set the value in the ColumnValue object.
/// </summary>
/// <param name="value">An array of bytes.</param>
/// <param name="startIndex">The starting position within the bytes.</param>
/// <param name="count">The number of bytes to decode.</param>
/// <param name="err">The error returned from ESENT.</param>
protected override void GetValueFromBytes(byte[] value, int startIndex, int count, int err)
{
if (JET_wrn.ColumnNull == (JET_wrn)err)
{
this.Value = null;
}
else
{
this.CheckDataCount(count);
this.Value = BitConverter.ToBoolean(value, startIndex);
}
}
}
}

View File

@ -0,0 +1,51 @@
//-----------------------------------------------------------------------
// <copyright file="BoxedValueCache.cs" company="Microsoft Corporation">
// Copyright (c) Microsoft Corporation.
// </copyright>
//-----------------------------------------------------------------------
namespace Microsoft.Isam.Esent.Interop
{
using System;
/// <summary>
/// A cache for boxed values.
/// </summary>
/// <typeparam name="T">The type of object to cache.</typeparam>
internal static class BoxedValueCache<T> where T : struct, IEquatable<T>
{
/// <summary>
/// Number of boxed values to cache.
/// </summary>
private const int NumCachedBoxedValues = 257;
/// <summary>
/// Cached boxed values.
/// </summary>
private static readonly object[] BoxedValues = new object[NumCachedBoxedValues];
/// <summary>
/// Gets a boxed version of the value. A cached copy is used if possible.
/// </summary>
/// <param name="value">The value to box.</param>
/// <returns>A boxed version of the value.</returns>
public static object GetBoxedValue(T? value)
{
if (!value.HasValue)
{
return null;
}
T valueToBox = value.Value;
int index = (valueToBox.GetHashCode() & 0x7fffffff) % NumCachedBoxedValues;
object boxedValue = BoxedValues[index];
if (null == boxedValue || !((T)boxedValue).Equals(valueToBox))
{
boxedValue = valueToBox;
BoxedValues[index] = boxedValue;
}
return boxedValue;
}
}
}

View File

@ -0,0 +1,68 @@
//-----------------------------------------------------------------------
// <copyright file="ByteColumnValue.cs" company="Microsoft Corporation">
// Copyright (c) Microsoft Corporation.
// </copyright>
//-----------------------------------------------------------------------
namespace Microsoft.Isam.Esent.Interop
{
using System.Diagnostics;
/// <summary>
/// A <see cref="byte"/> column value.
/// </summary>
public class ByteColumnValue : ColumnValueOfStruct<byte>
{
/// <summary>
/// Gets the size of the value in the column. This returns 0 for
/// variable sized columns (i.e. binary and string).
/// </summary>
protected override int Size
{
[DebuggerStepThrough]
get { return sizeof(byte); }
}
/// <summary>
/// Recursive SetColumns method for data pinning. This populates the buffer and
/// calls the inherited SetColumns method.
/// </summary>
/// <param name="sesid">The session to use.</param>
/// <param name="tableid">
/// The table to set the columns in. An update should be prepared.
/// </param>
/// <param name="columnValues">
/// Column values to set.
/// </param>
/// <param name="nativeColumns">
/// Structures to put the pinned data in.
/// </param>
/// <param name="i">Offset of this object in the array.</param>
/// <returns>An error code.</returns>
internal override unsafe int SetColumns(JET_SESID sesid, JET_TABLEID tableid, ColumnValue[] columnValues, NATIVE_SETCOLUMN* nativeColumns, int i)
{
var data = this.Value.GetValueOrDefault();
return this.SetColumns(sesid, tableid, columnValues, nativeColumns, i, &data, sizeof(byte), this.Value.HasValue);
}
/// <summary>
/// Given data retrieved from ESENT, decode the data and set the value in the ColumnValue object.
/// </summary>
/// <param name="value">An array of bytes.</param>
/// <param name="startIndex">The starting position within the bytes.</param>
/// <param name="count">The number of bytes to decode.</param>
/// <param name="err">The error returned from ESENT.</param>
protected override void GetValueFromBytes(byte[] value, int startIndex, int count, int err)
{
if (JET_wrn.ColumnNull == (JET_wrn)err)
{
this.Value = null;
}
else
{
this.CheckDataCount(count);
this.Value = value[startIndex];
}
}
}
}

View File

@ -0,0 +1,136 @@
//-----------------------------------------------------------------------
// <copyright file="BytesColumnValue.cs" company="Microsoft Corporation">
// Copyright (c) Microsoft Corporation.
// </copyright>
//-----------------------------------------------------------------------
namespace Microsoft.Isam.Esent.Interop
{
using System;
using System.Diagnostics;
/// <summary>
/// A byte array column value.
/// </summary>
public class BytesColumnValue : ColumnValue
{
/// <summary>
/// Internal value.
/// </summary>
private byte[] internalValue;
/// <summary>
/// Gets the last set or retrieved value of the column. The
/// value is returned as a generic object.
/// </summary>
public override object ValueAsObject
{
[DebuggerStepThrough]
get { return this.Value; }
}
/// <summary>
/// Gets or sets the value of the column. Use <see cref="Api.SetColumns"/> to update a
/// record with the column value.
/// </summary>
public byte[] Value
{
get
{
return this.internalValue;
}
set
{
this.internalValue = value;
this.Error = value == null ? JET_wrn.ColumnNull : JET_wrn.Success;
}
}
/// <summary>
/// Gets the byte length of a column value, which is zero if column is null, otherwise
/// matches the actual length of the byte array.
/// </summary>
public override int Length
{
get { return this.Value != null ? this.Value.Length : 0; }
}
/// <summary>
/// Gets the size of the value in the column. This returns 0 for
/// variable sized columns (i.e. binary and string).
/// </summary>
protected override int Size
{
[DebuggerStepThrough]
get { return 0; }
}
/// <summary>
/// Returns a <see cref="T:System.String"/> that represents the current <see cref="BytesColumnValue"/>.
/// </summary>
/// <returns>
/// A <see cref="T:System.String"/> that represents the current <see cref="BytesColumnValue"/>.
/// </returns>
public override string ToString()
{
if (null == this.Value)
{
return string.Empty;
}
return BitConverter.ToString(this.Value, 0, Math.Min(this.Value.Length, 16));
}
/// <summary>
/// Recursive SetColumns method for data pinning. This populates the buffer and
/// calls the inherited SetColumns method.
/// </summary>
/// <param name="sesid">The session to use.</param>
/// <param name="tableid">
/// The table to set the columns in. An update should be prepared.
/// </param>
/// <param name="columnValues">
/// Column values to set.
/// </param>
/// <param name="nativeColumns">
/// Structures to put the pinned data in.
/// </param>
/// <param name="i">Offset of this object in the array.</param>
/// <returns>An error code.</returns>
internal override unsafe int SetColumns(JET_SESID sesid, JET_TABLEID tableid, ColumnValue[] columnValues, NATIVE_SETCOLUMN* nativeColumns, int i)
{
if (null != this.Value)
{
fixed (void* buffer = this.Value)
{
return this.SetColumns(
sesid, tableid, columnValues, nativeColumns, i, buffer, this.Value.Length, true);
}
}
return this.SetColumns(sesid, tableid, columnValues, nativeColumns, i, null, 0, false);
}
/// <summary>
/// Given data retrieved from ESENT, decode the data and set the value in the ColumnValue object.
/// </summary>
/// <param name="value">An array of bytes.</param>
/// <param name="startIndex">The starting position within the bytes.</param>
/// <param name="count">The number of bytes to decode.</param>
/// <param name="err">The error returned from ESENT.</param>
protected override void GetValueFromBytes(byte[] value, int startIndex, int count, int err)
{
if (JET_wrn.ColumnNull == (JET_wrn)err)
{
this.Value = null;
}
else
{
var copiedValue = new byte[count];
Buffer.BlockCopy(value, startIndex, copiedValue, 0, count);
this.Value = copiedValue;
}
}
}
}

View File

@ -0,0 +1,79 @@
//-----------------------------------------------------------------------
// <copyright file="Caches.cs" company="Microsoft Corporation">
// Copyright (c) Microsoft Corporation.
// </copyright>
//-----------------------------------------------------------------------
namespace Microsoft.Isam.Esent.Interop
{
using System.Diagnostics;
/// <summary>
/// Static class containing MemoryCaches for different ESENT buffers.
/// Use these to avoid memory allocations when the memory will be
/// used for a brief time.
/// </summary>
internal static class Caches
{
/// <summary>
/// The maximum key size that any version of ESENT can have for
/// any page size. This is also the maximum bookmark size.
/// </summary>
private const int KeyMostMost = 2000;
/// <summary>
/// Reserve 1 extra space for keys made with prefix or wildcard.
/// </summary>
private const int LimitKeyMostMost = KeyMostMost + 1;
/// <summary>
/// The maximum number of buffers we want in a cache.
/// </summary>
private const int MaxBuffers = 16;
/// <summary>
/// Cached buffers for columns.
/// </summary>
private static readonly MemoryCache TheColumnCache = new MemoryCache(128 * 1024, MaxBuffers);
/// <summary>
/// Cached buffers for keys and bookmarks.
/// </summary>
private static readonly MemoryCache TheBookmarkCache = new MemoryCache(LimitKeyMostMost, MaxBuffers);
/// <summary>
/// Cached buffers for keys and bookmarks.
/// </summary>
private static readonly MemoryCache TheSecondaryBookmarkCache = new MemoryCache(LimitKeyMostMost, MaxBuffers);
/// <summary>
/// Gets the cached buffers for columns.
/// </summary>
public static MemoryCache ColumnCache
{
[DebuggerStepThrough]
get { return TheColumnCache; }
}
/// <summary>
/// Gets the cached buffers for keys and bookmarks.
/// </summary>
public static MemoryCache BookmarkCache
{
[DebuggerStepThrough]
get { return TheBookmarkCache; }
}
/// <summary>
/// Gets the cached buffers for keys and secondary bookmarks.
/// </summary>
public static MemoryCache SecondaryBookmarkCache
{
[DebuggerStepThrough]
get
{
return TheSecondaryBookmarkCache;
}
}
}
}

View File

@ -0,0 +1,98 @@
//-----------------------------------------------------------------------
// <copyright file="CallbackWrappers.cs" company="Microsoft Corporation">
// Copyright (c) Microsoft Corporation.
// </copyright>
//-----------------------------------------------------------------------
namespace Microsoft.Isam.Esent.Interop
{
using System.Collections.Generic;
/// <summary>
/// <para>
/// A collection of wrapped callbacks. This is used when the wrapped callback
/// can be garbage collected. The wrappers should be removed from the collection
/// when the callback is collected.
/// </para>
/// <para>
/// Removing the wrappers can lead to crashes. In this case we trust
/// the client code to keep its callback alive until ESENT doesn't need it any
/// more. Once the wrapped callback is garbage collected we allow the wrapper
/// to be collected as well. If ESENT subsequently uses the callback there will
/// be a crash.
/// </para>
/// <para>
/// The reason this is hard to deal with is that the lifetime of a JET_CALLBACK
/// isn't very clear. Table callbacks can stick around until the table meta-data
/// is purged, while a JetDefragment callback can be used until defrag ends. On
/// the other hand, keeping the callback wrapper alive indefinitely would lead
/// to unbounded memory use.
/// </para>
/// </summary>
internal sealed class CallbackWrappers
{
/// <summary>
/// Used to synchronize access to this object.
/// </summary>
private readonly object lockObject = new object();
/// <summary>
/// A list of the wrapped callbacks.
/// </summary>
private readonly List<JetCallbackWrapper> callbackWrappers = new List<JetCallbackWrapper>();
/// <summary>
/// Wrap a callback and returns its wrapper. If the callback is
/// already wrapped then the existing wrapper is returned.
/// </summary>
/// <param name="callback">The callback to add.</param>
/// <returns>The callback wrapper for the callback.</returns>
public JetCallbackWrapper Add(JET_CALLBACK callback)
{
lock (this.lockObject)
{
JetCallbackWrapper wrapper;
if (!this.TryFindWrapperFor(callback, out wrapper))
{
wrapper = new JetCallbackWrapper(callback);
this.callbackWrappers.Add(wrapper);
}
return wrapper;
}
}
/// <summary>
/// Go through the collection of callback wrappers and remove any dead callbacks.
/// </summary>
public void Collect()
{
lock (this.lockObject)
{
this.callbackWrappers.RemoveAll(wrapper => !wrapper.IsAlive);
}
}
/// <summary>
/// Look in the list of callback wrappers to see if there is already an entry for
/// this callback.
/// </summary>
/// <param name="callback">The callback to look for.</param>
/// <param name="wrapper">Returns the wrapper, if found.</param>
/// <returns>True if a wrapper was found, false otherwise.</returns>
private bool TryFindWrapperFor(JET_CALLBACK callback, out JetCallbackWrapper wrapper)
{
foreach (JetCallbackWrapper w in this.callbackWrappers)
{
if (w.IsWrapping(callback))
{
wrapper = w;
return true;
}
}
wrapper = null;
return false;
}
}
}

View File

@ -0,0 +1,101 @@
//-----------------------------------------------------------------------
// <copyright file="ColumnInfo.cs" company="Microsoft Corporation">
// Copyright (c) Microsoft Corporation.
// </copyright>
//-----------------------------------------------------------------------
namespace Microsoft.Isam.Esent.Interop
{
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
/// <summary>
/// Information about one Esent column. This is not an interop
/// class, but is used by the meta-data helper methods.
/// </summary>
public sealed class ColumnInfo
{
/// <summary>
/// The default value of the column.
/// </summary>
private readonly ReadOnlyCollection<byte> defaultValue;
/// <summary>
/// Initializes a new instance of the ColumnInfo class.
/// </summary>
/// <param name="name">Name of the column.</param>
/// <param name="columnid">ID of the column.</param>
/// <param name="coltyp">Type of the column.</param>
/// <param name="cp">Codepage of the column.</param>
/// <param name="maxLength">Maximum length of the column.</param>
/// <param name="defaultValue">Column default value.</param>
/// <param name="grbit">Column option.</param>
internal ColumnInfo(
string name,
JET_COLUMNID columnid,
JET_coltyp coltyp,
JET_CP cp,
int maxLength,
byte[] defaultValue,
ColumndefGrbit grbit)
{
this.Name = name;
this.Columnid = columnid;
this.Coltyp = coltyp;
this.Cp = cp;
this.MaxLength = maxLength;
this.defaultValue = (null == defaultValue) ? null : new ReadOnlyCollection<byte>(defaultValue);
this.Grbit = grbit;
}
/// <summary>
/// Gets the name of the column.
/// </summary>
public string Name { get; private set; }
/// <summary>
/// Gets the ID of the column.
/// </summary>
public JET_COLUMNID Columnid { get; private set; }
/// <summary>
/// Gets the type of the column.
/// </summary>
public JET_coltyp Coltyp { get; private set; }
/// <summary>
/// Gets the code page of the column.
/// </summary>
public JET_CP Cp { get; private set; }
/// <summary>
/// Gets the maximum length of the column.
/// </summary>
public int MaxLength { get; private set; }
/// <summary>
/// Gets the default value of the column.
/// </summary>
public IList<byte> DefaultValue
{
get { return this.defaultValue; }
}
/// <summary>
/// Gets the column options.
/// </summary>
public ColumndefGrbit Grbit { get; private set; }
/// <summary>
/// Returns a <see cref="T:System.String"/> that represents the current <see cref="ColumnInfo"/>.
/// </summary>
/// <returns>
/// A <see cref="T:System.String"/> that represents the current <see cref="ColumnInfo"/>.
/// </returns>
public override string ToString()
{
return this.Name;
}
}
}

View File

@ -0,0 +1,78 @@
//-----------------------------------------------------------------------
// <copyright file="ColumnInfoEnumerator.cs" company="Microsoft Corporation">
// Copyright (c) Microsoft Corporation.
// </copyright>
//-----------------------------------------------------------------------
namespace Microsoft.Isam.Esent.Interop
{
using System.Text;
using Microsoft.Isam.Esent.Interop.Implementation;
/// <summary>
/// Base class for enumerators that return ColumnInfo objects. Subclasses differ
/// by how they open the table.
/// </summary>
internal abstract class ColumnInfoEnumerator : TableEnumerator<ColumnInfo>
{
/// <summary>
/// Initializes a new instance of the <see cref="ColumnInfoEnumerator"/> class.
/// </summary>
/// <param name="sesid">
/// The session to use.
/// </param>
protected ColumnInfoEnumerator(JET_SESID sesid) : base(sesid)
{
}
/// <summary>
/// Gets or sets the columnlist used to retrieve data.
/// </summary>
protected JET_COLUMNLIST Columnlist { get; set; }
/// <summary>
/// Gets the entry the cursor is currently positioned on.
/// </summary>
/// <returns>The entry the cursor is currently positioned on.</returns>
protected override ColumnInfo GetCurrent()
{
return GetColumnInfoFromColumnlist(this.Sesid, this.Columnlist);
}
/// <summary>
/// Create a ColumnInfo object from the data in the current JET_COLUMNLIST entry.
/// </summary>
/// <param name="sesid">The session to use.</param>
/// <param name="columnlist">The columnlist to take the data from.</param>
/// <returns>A ColumnInfo object containing the information from that record.</returns>
private static ColumnInfo GetColumnInfoFromColumnlist(JET_SESID sesid, JET_COLUMNLIST columnlist)
{
// As of Sep 2015, JetGetColumnInfoW is only called for Win8+. Even though Unicode should have
// worked in Win7, it wasn't reliable until Win8.
Encoding encodingOfTextColumns = EsentVersion.SupportsWindows8Features ? Encoding.Unicode : LibraryHelpers.EncodingASCII;
string name = Api.RetrieveColumnAsString(
sesid,
columnlist.tableid,
columnlist.columnidcolumnname,
encodingOfTextColumns,
RetrieveColumnGrbit.None);
name = StringCache.TryToIntern(name);
var columnidValue = (uint)Api.RetrieveColumnAsUInt32(sesid, columnlist.tableid, columnlist.columnidcolumnid);
var coltypValue = (uint)Api.RetrieveColumnAsUInt32(sesid, columnlist.tableid, columnlist.columnidcoltyp);
uint codepageValue = (ushort)Api.RetrieveColumnAsUInt16(sesid, columnlist.tableid, columnlist.columnidCp);
var maxLength = (uint)Api.RetrieveColumnAsUInt32(sesid, columnlist.tableid, columnlist.columnidcbMax);
byte[] defaultValue = Api.RetrieveColumn(sesid, columnlist.tableid, columnlist.columnidDefault);
var grbitValue = (uint)Api.RetrieveColumnAsUInt32(sesid, columnlist.tableid, columnlist.columnidgrbit);
return new ColumnInfo(
name,
new JET_COLUMNID { Value = columnidValue },
(JET_coltyp)coltypValue,
(JET_CP)codepageValue,
unchecked((int)maxLength),
defaultValue,
(ColumndefGrbit)grbitValue);
}
}
}

View File

@ -0,0 +1,357 @@
//-----------------------------------------------------------------------
// <copyright file="ColumnStream.cs" company="Microsoft Corporation">
// Copyright (c) Microsoft Corporation.
// </copyright>
//-----------------------------------------------------------------------
namespace Microsoft.Isam.Esent.Interop
{
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Diagnostics.CodeAnalysis;
using System.Globalization;
using System.IO;
/// <summary>
/// This class provides a streaming interface to a long-value column
/// (i.e. a column of type <see cref="JET_coltyp.LongBinary"/> or
/// <see cref="JET_coltyp.LongText"/>).
/// </summary>
[SuppressMessage("Microsoft.StyleCop.CSharp.NamingRules",
"SA1305:FieldNamesMustNotUseHungarianNotation",
Justification = "This should match the unmanaged API, which isn't capitalized.")]
public class ColumnStream : Stream
{
/// <summary>
/// The size of the biggest long-value column ESENT supports.
/// </summary>
private const int MaxLongValueSize = 0x7fffffff;
/// <summary>
/// Session to use.
/// </summary>
private readonly JET_SESID sesid;
/// <summary>
/// Cursor to use.
/// </summary>
private readonly JET_TABLEID tableid;
/// <summary>
/// Columnid to use.
/// </summary>
private readonly JET_COLUMNID columnid;
/// <summary>
/// Current LV offset.
/// </summary>
private int ibLongValue;
/// <summary>
/// Initializes a new instance of the ColumnStream class.
/// </summary>
/// <param name="sesid">The session to use.</param>
/// <param name="tableid">The cursor to use.</param>
/// <param name="columnid">The columnid of the column to set/retrieve data from.</param>
public ColumnStream(JET_SESID sesid, JET_TABLEID tableid, JET_COLUMNID columnid)
{
// In some cases we rely on Int32 arithmetic overflow checking to catch
// errors, which assumes that a long-value can store Int32.MaxValue bytes.
Debug.Assert(MaxLongValueSize == int.MaxValue, "Expected maximum long value size to be Int32.MaxValue");
this.sesid = sesid;
this.tableid = tableid;
this.columnid = columnid;
this.Itag = 1;
}
/// <summary>
/// Gets or sets the itag of the column.
/// </summary>
public int Itag { get; set; }
/// <summary>
/// Gets a value indicating whether the stream supports reading.
/// </summary>
public override bool CanRead
{
[DebuggerStepThrough]
get { return true; }
}
/// <summary>
/// Gets a value indicating whether the stream supports writing.
/// </summary>
public override bool CanWrite
{
[DebuggerStepThrough]
get { return true; }
}
/// <summary>
/// Gets a value indicating whether the stream supports seeking.
/// </summary>
public override bool CanSeek
{
[DebuggerStepThrough]
get { return true; }
}
/// <summary>
/// Gets or sets the current position in the stream.
/// </summary>
public override long Position
{
[DebuggerStepThrough]
get
{
return this.ibLongValue;
}
set
{
if (value < 0 || value > MaxLongValueSize)
{
throw new ArgumentOutOfRangeException("value", value, "A long-value offset has to be between 0 and 0x7fffffff bytes");
}
this.ibLongValue = checked((int)value);
}
}
/// <summary>
/// Gets the current length of the stream.
/// </summary>
public override long Length
{
get
{
int size;
var retinfo = new JET_RETINFO { itagSequence = this.Itag, ibLongValue = 0 };
Api.JetRetrieveColumn(this.sesid, this.tableid, this.columnid, null, 0, out size, RetrieveGrbit, retinfo);
return size;
}
}
/// <summary>
/// Gets the options that should be used with JetRetrieveColumn.
/// </summary>
private static RetrieveColumnGrbit RetrieveGrbit
{
[DebuggerStepThrough]
get
{
// Always use the RetrieveCopy options. This makes the ColumnStream work
// well when setting a column. If we don't always use RetrieveCopy then
// things like seeking from the end of a column might not work properly.
return RetrieveColumnGrbit.RetrieveCopy;
}
}
/// <summary>
/// Returns a <see cref="T:System.String"/> that represents the current <see cref="ColumnStream"/>.
/// </summary>
/// <returns>
/// A <see cref="T:System.String"/> that represents the current <see cref="ColumnStream"/>.
/// </returns>
public override string ToString()
{
return string.Format(CultureInfo.InvariantCulture, "ColumnStream(0x{0:x}:{1})", this.columnid.Value, this.Itag);
}
/// <summary>
/// Flush the stream.
/// </summary>
public override void Flush()
{
// nothing is required
}
/// <summary>
/// Writes a sequence of bytes to the current stream and advances the current
/// position within this stream by the number of bytes written.
/// </summary>
/// <param name="buffer">The buffer to write from.</param>
/// <param name="offset">The offset in the buffer to write.</param>
/// <param name="count">The number of bytes to write.</param>
public override void Write(byte[] buffer, int offset, int count)
{
CheckBufferArguments(buffer, offset, count);
int length = checked((int)this.Length);
JET_SETINFO setinfo;
int newIbLongValue = checked(this.ibLongValue + count);
// If our current position is beyond the end of the LV extend
// the LV to the write point
if (this.ibLongValue > length)
{
setinfo = new JET_SETINFO { itagSequence = this.Itag };
Api.JetSetColumn(this.sesid, this.tableid, this.columnid, null, this.ibLongValue, SetColumnGrbit.SizeLV, setinfo);
length = this.ibLongValue;
}
SetColumnGrbit grbit;
if (this.ibLongValue == length)
{
grbit = SetColumnGrbit.AppendLV;
}
else if (newIbLongValue >= length)
{
grbit = SetColumnGrbit.OverwriteLV | SetColumnGrbit.SizeLV;
}
else
{
grbit = SetColumnGrbit.OverwriteLV;
}
setinfo = new JET_SETINFO { itagSequence = this.Itag, ibLongValue = this.ibLongValue };
Api.JetSetColumn(this.sesid, this.tableid, this.columnid, buffer, count, offset, grbit, setinfo);
checked
{
this.ibLongValue += count;
}
}
/// <summary>
/// Reads a sequence of bytes from the current stream and advances the
/// position within the stream by the number of bytes read.
/// </summary>
/// <param name="buffer">The buffer to read into.</param>
/// <param name="offset">The offset in the buffer to read into.</param>
/// <param name="count">The number of bytes to read.</param>
/// <returns>The number of bytes read into the buffer.</returns>
public override int Read(byte[] buffer, int offset, int count)
{
CheckBufferArguments(buffer, offset, count);
if (this.ibLongValue >= this.Length)
{
return 0;
}
int length;
var retinfo = new JET_RETINFO { itagSequence = this.Itag, ibLongValue = this.ibLongValue };
Api.JetRetrieveColumn(this.sesid, this.tableid, this.columnid, buffer, count, offset, out length, RetrieveGrbit, retinfo);
int bytesRead = Math.Min(length, count);
checked
{
this.ibLongValue += bytesRead;
}
return bytesRead;
}
/// <summary>
/// Sets the length of the stream.
/// </summary>
/// <param name="value">The desired length, in bytes.</param>
public override void SetLength(long value)
{
if (value > MaxLongValueSize || value < 0)
{
throw new ArgumentOutOfRangeException("value", value, "A LongValueStream cannot be longer than 0x7FFFFFF or less than 0 bytes");
}
if (value < this.Length && value > 0)
{
// BUG: Shrinking the column multiple times and then growing it can sometimes hit an unpleasant
// ESENT defect which causes a hang. To make sure we never have that problem we read out the data,
// and insert into a new long-value. This is not efficient.
var data = new byte[value];
var retinfo = new JET_RETINFO { itagSequence = this.Itag, ibLongValue = 0 };
int actualDataSize;
Api.JetRetrieveColumn(
this.sesid,
this.tableid,
this.columnid,
data,
data.Length,
out actualDataSize,
RetrieveGrbit,
retinfo);
var setinfo = new JET_SETINFO { itagSequence = this.Itag };
Api.JetSetColumn(this.sesid, this.tableid, this.columnid, data, data.Length, SetColumnGrbit.None, setinfo);
}
else
{
var setinfo = new JET_SETINFO { itagSequence = this.Itag };
SetColumnGrbit grbit = (0 == value) ? SetColumnGrbit.ZeroLength : SetColumnGrbit.SizeLV;
Api.JetSetColumn(this.sesid, this.tableid, this.columnid, null, checked((int)value), grbit, setinfo);
}
// Setting the length moves the offset back to the end of the data
if (this.ibLongValue > value)
{
this.ibLongValue = checked((int)value);
}
}
/// <summary>
/// Sets the position in the current stream.
/// </summary>
/// <param name="offset">Byte offset relative to the origin parameter.</param>
/// <param name="origin">A SeekOrigin indicating the reference point for the new position.</param>
/// <returns>The new position in the current stream.</returns>
public override long Seek(long offset, SeekOrigin origin)
{
long newOffset;
switch (origin)
{
case SeekOrigin.Begin:
newOffset = offset;
break;
case SeekOrigin.End:
newOffset = checked(this.Length + offset);
break;
case SeekOrigin.Current:
newOffset = checked(this.ibLongValue + offset);
break;
default:
throw new ArgumentOutOfRangeException("origin", origin, "Unknown origin");
}
if (newOffset < 0 || newOffset > MaxLongValueSize)
{
throw new ArgumentOutOfRangeException("offset", offset, "invalid offset/origin combination");
}
this.ibLongValue = checked((int)newOffset);
return this.ibLongValue;
}
/// <summary>
/// Check the buffer arguments given to Read/Write .
/// </summary>
/// <param name="buffer">The buffer.</param>
/// <param name="offset">The offset in the buffer to read/write to.</param>
/// <param name="count">The number of bytes to read/write.</param>
private static void CheckBufferArguments(ICollection<byte> buffer, int offset, int count)
{
if (null == buffer)
{
throw new ArgumentNullException("buffer");
}
if (offset < 0)
{
throw new ArgumentOutOfRangeException("offset", offset, "cannot be negative");
}
if (count < 0)
{
throw new ArgumentOutOfRangeException("count", count, "cannot be negative");
}
if (checked(buffer.Count - offset) < count)
{
throw new ArgumentOutOfRangeException("count", count, "cannot be larger than the size of the buffer");
}
}
}
}

View File

@ -0,0 +1,382 @@
//-----------------------------------------------------------------------
// <copyright file="ColumnValue.cs" company="Microsoft Corporation">
// Copyright (c) Microsoft Corporation.
// </copyright>
//-----------------------------------------------------------------------
namespace Microsoft.Isam.Esent.Interop
{
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Globalization;
/// <summary>
/// Base class for objects that represent a column value to be set.
/// </summary>
public abstract partial class ColumnValue
{
/// <summary>
/// Internal grbit.
/// </summary>
private RetrieveColumnGrbit grbit;
/// <summary>
/// Initializes a new instance of the ColumnValue class.
/// </summary>
protected ColumnValue()
{
this.ItagSequence = 1;
}
/// <summary>
/// Gets or sets the columnid to be set or retrieved.
/// </summary>
public JET_COLUMNID Columnid { get; set; }
/// <summary>
/// Gets the last set or retrieved value of the column. The
/// value is returned as a generic object.
/// </summary>
public abstract object ValueAsObject { get; }
/// <summary>
/// Gets or sets column update options.
/// </summary>
public SetColumnGrbit SetGrbit { get; set; }
/// <summary>
/// Gets or sets column retrieval options.
/// </summary>
public RetrieveColumnGrbit RetrieveGrbit
{
get
{
return this.grbit;
}
set
{
this.ValidateRetrieveGrbit(value);
this.grbit = value;
}
}
/// <summary>
/// Gets or sets the column itag sequence.
/// </summary>
public int ItagSequence { get; set; }
/// <summary>
/// Gets the warning generated by retrieving or setting this column.
/// </summary>
public JET_wrn Error { get; internal set; }
/// <summary>
/// Gets the byte length of a column value, which is zero if column is null, otherwise
/// it matches the Size for fixed-size columns and represent the actual value byte
/// length for variable sized columns (i.e. binary and string). For strings the length
/// is determined in assumption two bytes per character.
/// </summary>
public abstract int Length { get; }
/// <summary>
/// Gets the size of the value in the column. This returns 0 for
/// variable sized columns (i.e. binary and string).
/// </summary>
protected abstract int Size { get; }
/// <summary>
/// Returns a <see cref="T:System.String"/> that represents the current <see cref="ColumnValue"/>.
/// </summary>
/// <returns>
/// A <see cref="T:System.String"/> that represents the current <see cref="ColumnValue"/>.
/// </returns>
public abstract override string ToString();
/// <summary>
/// Recursive RetrieveColumns method for data pinning. This should pin a buffer and
/// call the inherited RetrieveColumns method.
/// </summary>
/// <param name="sesid">The session to use.</param>
/// <param name="tableid">
/// The table to retrieve the columns from.
/// </param>
/// <param name="columnValues">
/// Column values to retrieve.
/// </param>
internal static void RetrieveColumns(JET_SESID sesid, JET_TABLEID tableid, ColumnValue[] columnValues)
{
const int MaxColumnValues = 1024;
if (columnValues.Length > MaxColumnValues)
{
throw new ArgumentOutOfRangeException("columnValues", columnValues.Length, "Too many column values");
}
unsafe
{
byte[] buffer = null;
NATIVE_RETRIEVECOLUMN* nativeRetrievecolumns = stackalloc NATIVE_RETRIEVECOLUMN[columnValues.Length];
try
{
buffer = Caches.ColumnCache.Allocate();
Debug.Assert(MaxColumnValues * 16 < buffer.Length, "Maximum size of fixed columns could exceed buffer size");
fixed (byte* pinnedBuffer = buffer)
{
byte* currentBuffer = pinnedBuffer;
int numVariableLengthColumns = columnValues.Length;
// First the fixed-size columns
for (int i = 0; i < columnValues.Length; ++i)
{
if (0 != columnValues[i].Size)
{
columnValues[i].MakeNativeRetrieveColumn(ref nativeRetrievecolumns[i]);
nativeRetrievecolumns[i].pvData = new IntPtr(currentBuffer);
nativeRetrievecolumns[i].cbData = checked((uint)columnValues[i].Size);
currentBuffer += nativeRetrievecolumns[i].cbData;
Debug.Assert(currentBuffer <= pinnedBuffer + buffer.Length, "Moved past end of pinned buffer");
numVariableLengthColumns--;
}
}
// Now the variable-length columns
if (numVariableLengthColumns > 0)
{
int bufferUsed = checked((int)(currentBuffer - pinnedBuffer));
int bufferRemaining = checked(buffer.Length - bufferUsed);
int bufferPerColumn = bufferRemaining / numVariableLengthColumns;
Debug.Assert(bufferPerColumn > 0, "Not enough buffer left to retrieve variable length columns");
// Now the variable-size columns
for (int i = 0; i < columnValues.Length; ++i)
{
if (0 == columnValues[i].Size)
{
columnValues[i].MakeNativeRetrieveColumn(ref nativeRetrievecolumns[i]);
nativeRetrievecolumns[i].pvData = new IntPtr(currentBuffer);
nativeRetrievecolumns[i].cbData = checked((uint)bufferPerColumn);
currentBuffer += nativeRetrievecolumns[i].cbData;
Debug.Assert(currentBuffer <= pinnedBuffer + buffer.Length, "Moved past end of pinned buffer");
}
}
}
// Retrieve the columns
Api.Check(Api.Impl.JetRetrieveColumns(sesid, tableid, nativeRetrievecolumns, columnValues.Length));
// Propagate the warnings and output.
for (int i = 0; i < columnValues.Length; ++i)
{
columnValues[i].Error = (JET_wrn)nativeRetrievecolumns[i].err;
columnValues[i].ItagSequence = (int)nativeRetrievecolumns[i].itagSequence;
}
// Now parse out the columns that were retrieved successfully
for (int i = 0; i < columnValues.Length; ++i)
{
if (nativeRetrievecolumns[i].err != (int)JET_wrn.BufferTruncated)
{
byte* columnBuffer = (byte*)nativeRetrievecolumns[i].pvData;
int startIndex = checked((int)(columnBuffer - pinnedBuffer));
columnValues[i].GetValueFromBytes(
buffer,
startIndex,
checked((int)nativeRetrievecolumns[i].cbActual),
nativeRetrievecolumns[i].err);
}
}
}
// Finally retrieve the buffers where the columns weren't large enough.
RetrieveTruncatedBuffers(sesid, tableid, columnValues, nativeRetrievecolumns);
}
finally
{
if (buffer != null)
{
Caches.ColumnCache.Free(ref buffer);
}
}
}
}
/// <summary>
/// Recursive SetColumns method for data pinning. This should populate the buffer and
/// call the inherited SetColumns method.
/// </summary>
/// <param name="sesid">The session to use.</param>
/// <param name="tableid">
/// The table to set the columns in. An update should be prepared.
/// </param>
/// <param name="columnValues">
/// Column values to set.
/// </param>
/// <param name="nativeColumns">
/// Structures to put the pinned data in.
/// </param>
/// <param name="i">Offset of this object in the array.</param>
/// <returns>An error code.</returns>
internal abstract unsafe int SetColumns(JET_SESID sesid, JET_TABLEID tableid, ColumnValue[] columnValues, NATIVE_SETCOLUMN* nativeColumns, int i);
/// <summary>
/// Recursive SetColumns function used to pin data.
/// </summary>
/// <param name="sesid">The session to use.</param>
/// <param name="tableid">
/// The table to set the columns in. An update should be prepared.
/// </param>
/// <param name="columnValues">
/// Column values to set.
/// </param>
/// <param name="nativeColumns">
/// Structures to put the pinned data in.
/// </param>
/// <param name="i">Offset of this object in the array.</param>
/// <param name="buffer">The buffer for this object.</param>
/// <param name="bufferSize">Size of the buffer for ths object.</param>
/// <param name="hasValue">True if this object is non null.</param>
/// <returns>An error code.</returns>
/// <remarks>
/// This is marked as internal because it uses the NATIVE_SETCOLUMN type
/// which is also marked as internal. It should be treated as a protected
/// method though.
/// </remarks>
internal unsafe int SetColumns(
JET_SESID sesid,
JET_TABLEID tableid,
ColumnValue[] columnValues,
NATIVE_SETCOLUMN* nativeColumns,
int i,
void* buffer,
int bufferSize,
bool hasValue)
{
Debug.Assert(this == columnValues[i], "SetColumns should be called on the current object");
this.MakeNativeSetColumn(ref nativeColumns[i]);
if (hasValue)
{
nativeColumns[i].cbData = checked((uint)bufferSize);
nativeColumns[i].pvData = new IntPtr(buffer);
if (0 == bufferSize)
{
nativeColumns[i].grbit |= (uint)SetColumnGrbit.ZeroLength;
}
}
int err = i == columnValues.Length - 1
? Api.Impl.JetSetColumns(sesid, tableid, nativeColumns, columnValues.Length)
: columnValues[i + 1].SetColumns(sesid, tableid, columnValues, nativeColumns, i + 1);
this.Error = (JET_wrn)nativeColumns[i].err;
return err;
}
/// <summary>
/// Given data retrieved from ESENT, decode the data and set the value in the ColumnValue object.
/// </summary>
/// <param name="value">An array of bytes.</param>
/// <param name="startIndex">The starting position within the bytes.</param>
/// <param name="count">The number of bytes to decode.</param>
/// <param name="err">The error returned from ESENT.</param>
protected abstract void GetValueFromBytes(byte[] value, int startIndex, int count, int err);
/// <summary>
/// Validation for the requested retrieve options for the column.
/// </summary>
/// <param name="grbit">The retrieve options to validate.</param>
protected virtual void ValidateRetrieveGrbit(RetrieveColumnGrbit grbit)
{
// We cannot support this request when there is no way to indicate that a column reference is returned.
if ((grbit & (RetrieveColumnGrbit)0x00020000) != 0) // UnpublishedGrbits.RetrieveAsRefIfNotInRecord
{
throw new EsentInvalidGrbitException();
}
}
/// <summary>
/// Retrieve the value for columns whose buffers were truncated.
/// </summary>
/// <param name="sesid">The session to use.</param>
/// <param name="tableid">The table to use.</param>
/// <param name="columnValues">The column values.</param>
/// <param name="nativeRetrievecolumns">
/// The native retrieve columns that match the column values.
/// </param>
private static unsafe void RetrieveTruncatedBuffers(JET_SESID sesid, JET_TABLEID tableid, ColumnValue[] columnValues, NATIVE_RETRIEVECOLUMN* nativeRetrievecolumns)
{
for (int i = 0; i < columnValues.Length; ++i)
{
if (nativeRetrievecolumns[i].err == (int)JET_wrn.BufferTruncated)
{
var buffer = new byte[nativeRetrievecolumns[i].cbActual];
int actualSize;
int err;
var retinfo = new JET_RETINFO { itagSequence = columnValues[i].ItagSequence };
// Pin the buffer and retrieve the data
fixed (byte* pinnedBuffer = buffer)
{
err = Api.Impl.JetRetrieveColumn(
sesid,
tableid,
columnValues[i].Columnid,
new IntPtr(pinnedBuffer),
buffer.Length,
out actualSize,
columnValues[i].RetrieveGrbit,
retinfo);
}
if (JET_wrn.BufferTruncated == (JET_wrn)err)
{
string error = string.Format(
CultureInfo.CurrentCulture,
"Column size changed from {0} to {1}. The record was probably updated by another thread.",
buffer.Length,
actualSize);
Trace.TraceError(error);
throw new InvalidOperationException(error);
}
// Throw errors, but put warnings in the structure
Api.Check(err);
columnValues[i].Error = (JET_wrn)err;
// For BytesColumnValue this will copy the data to a new array.
// If this situation becomes common we should simply use the array.
columnValues[i].GetValueFromBytes(buffer, 0, actualSize, err);
}
}
}
/// <summary>
/// Create a native SetColumn from this object.
/// </summary>
/// <param name="setcolumn">The native setcolumn structure to fill in.</param>
private void MakeNativeSetColumn(ref NATIVE_SETCOLUMN setcolumn)
{
setcolumn.columnid = this.Columnid.Value;
setcolumn.grbit = (uint)this.SetGrbit;
setcolumn.itagSequence = checked((uint)this.ItagSequence);
}
/// <summary>
/// Create a native RetrieveColumn from this object.
/// </summary>
/// <param name="retrievecolumn">
/// The retrieve column structure to fill in.
/// </param>
private void MakeNativeRetrieveColumn(ref NATIVE_RETRIEVECOLUMN retrievecolumn)
{
retrievecolumn.columnid = this.Columnid.Value;
retrievecolumn.grbit = (uint)this.RetrieveGrbit;
retrievecolumn.itagSequence = checked((uint)this.ItagSequence);
}
}
}

View File

@ -0,0 +1,82 @@
//-----------------------------------------------------------------------
// <copyright file="ColumnValueOfStruct.cs" company="Microsoft Corporation">
// Copyright (c) Microsoft Corporation.
// </copyright>
//-----------------------------------------------------------------------
namespace Microsoft.Isam.Esent.Interop
{
using System;
/// <summary>
/// Set a column of a struct type (e.g. <see cref="Int32"/>/<see cref="Guid"/>).
/// </summary>
/// <typeparam name="T">Type to set.</typeparam>
public abstract class ColumnValueOfStruct<T> : ColumnValue where T : struct, IEquatable<T>
{
/// <summary>
/// Internal value.
/// </summary>
private T? internalValue;
/// <summary>
/// Gets the last set or retrieved value of the column. The
/// value is returned as a generic object.
/// </summary>
public override object ValueAsObject
{
get
{
return BoxedValueCache<T>.GetBoxedValue(this.Value);
}
}
/// <summary>
/// Gets or sets the value in the struct.
/// </summary>
public T? Value
{
get
{
return this.internalValue;
}
set
{
this.internalValue = value;
this.Error = value == null ? JET_wrn.ColumnNull : JET_wrn.Success;
}
}
/// <summary>
/// Gets the byte length of a column value, which is zero if column is null, otherwise
/// it matches the Size for this fixed-size column.
/// </summary>
public override int Length
{
get { return this.Value.HasValue ? this.Size : 0; }
}
/// <summary>
/// Gets a string representation of this object.
/// </summary>
/// <returns>A string representation of this object.</returns>
public override string ToString()
{
return this.Value.ToString();
}
/// <summary>
/// Make sure the retrieved data is exactly the size needed for
/// the structure. An exception is thrown if there is a mismatch.
/// </summary>
/// <param name="count">The size of the retrieved data.</param>
protected void CheckDataCount(int count)
{
if (this.Size != count)
{
throw new EsentInvalidColumnException();
}
}
}
}

View File

@ -0,0 +1,175 @@
//-----------------------------------------------------------------------
// <copyright file="Conversions.cs" company="Microsoft Corporation">
// Copyright (c) Microsoft Corporation.
// </copyright>
//-----------------------------------------------------------------------
namespace Microsoft.Isam.Esent.Interop
{
using System;
using System.Collections.Generic;
using System.Globalization;
/// <summary>
/// Provide methods to convert data and flags between
/// Win32 and the .NET Framework.
/// </summary>
public static class Conversions
{
/// <summary>
/// Maps a CompareOption enumeration to the corresponding LCMapString flag.
/// </summary>
private static readonly IDictionary<CompareOptions, uint> CompareOptionsToLcmapFlags;
/// <summary>
/// Maps an LCMapString flag to the corresponding CompareOption enumeration.
/// </summary>
private static readonly IDictionary<uint, CompareOptions> LcmapFlagsToCompareOptions;
/// <summary>
/// Initializes static members of the Conversions class. This sets up the
/// conversion mapping dictionaries.
/// </summary>
static Conversions()
{
// Rather than creating both dictionaries, define one as the inverse of the other.
CompareOptionsToLcmapFlags = new Dictionary<CompareOptions, uint>
{
{ CompareOptions.IgnoreCase, NativeMethods.NORM_IGNORECASE },
{ CompareOptions.IgnoreKanaType, NativeMethods.NORM_IGNOREKANATYPE },
{ CompareOptions.IgnoreNonSpace, NativeMethods.NORM_IGNORENONSPACE },
{ CompareOptions.IgnoreSymbols, NativeMethods.NORM_IGNORESYMBOLS },
{ CompareOptions.IgnoreWidth, NativeMethods.NORM_IGNOREWIDTH },
{ CompareOptions.StringSort, NativeMethods.SORT_STRINGSORT }
};
LcmapFlagsToCompareOptions = InvertDictionary(CompareOptionsToLcmapFlags);
}
/// <summary>
/// Convert a double (OA date time format) to a DateTime. Unlike DateTime.FromOADate
/// this doesn't throw exceptions.
/// </summary>
/// <param name="d">The double value.</param>
/// <returns>A DateTime.</returns>
public static DateTime ConvertDoubleToDateTime(double d)
{
try
{
return LibraryHelpers.FromOADate(d);
}
catch (ArgumentException)
{
// Not all double values are valid OADates. We deal with out-of-range values
// by returning either min or max
return d < 0 ? DateTime.MinValue : DateTime.MaxValue;
}
}
/// <summary>
/// Given flags for LCMapFlags, turn them into compare options. Unknown options
/// are ignored.
/// </summary>
/// <param name="lcmapFlags">LCMapString flags.</param>
/// <returns>CompareOptions describing the (known) flags.</returns>
[CLSCompliant(false)]
public static CompareOptions CompareOptionsFromLCMapFlags(uint lcmapFlags)
{
// This should be a template, but there isn't an elegant way to express than with C# generics
CompareOptions options = CompareOptions.None;
foreach (uint flag in LcmapFlagsToCompareOptions.Keys)
{
if (flag == (lcmapFlags & flag))
{
options |= LcmapFlagsToCompareOptions[flag];
}
}
return options;
}
/// <summary>
/// Give CompareOptions, turn them into flags from LCMapString. Unknown options are ignored.
/// </summary>
/// <param name="compareOptions">The options to convert.</param>
/// <returns>The LCMapString flags that match the compare options. Unsupported options are ignored.</returns>
[CLSCompliant(false)]
public static uint LCMapFlagsFromCompareOptions(CompareOptions compareOptions)
{
// This should be a template, but there isn't an elegant way to express than with C# generics
uint flags = 0;
foreach (CompareOptions option in CompareOptionsToLcmapFlags.Keys)
{
if (option == (compareOptions & option))
{
flags |= CompareOptionsToLcmapFlags[option];
}
}
return flags;
}
/// <summary>
/// Given a Key=>Value dictionary create an inverted dictionary that maps Value=>Key.
/// </summary>
/// <typeparam name="TValue">The new value type (the key of the current dictionary).</typeparam>
/// <typeparam name="TKey">The new key type (the value if the current dictionary).</typeparam>
/// <param name="dict">The dictionary to invert.</param>
/// <returns>An inverted dictionary.</returns>
private static IDictionary<TKey, TValue> InvertDictionary<TValue, TKey>(ICollection<KeyValuePair<TValue, TKey>> dict)
{
var invertedDict = new Dictionary<TKey, TValue>(dict.Count);
foreach (KeyValuePair<TValue, TKey> entry in dict)
{
invertedDict.Add(entry.Value, entry.Key);
}
return invertedDict;
}
/// <summary>
/// This class contains the unmanaged constants used in the conversion.
/// </summary>
internal static class NativeMethods
{
#region Win32 Constants
/// <summary>
/// Ignore case.
/// </summary>
public const uint NORM_IGNORECASE = 0x00000001;
/// <summary>
/// Ignore nonspacing chars.
/// </summary>
public const uint NORM_IGNORENONSPACE = 0x00000002;
/// <summary>
/// Ignore symbols.
/// </summary>
public const uint NORM_IGNORESYMBOLS = 0x00000004;
/// <summary>
/// Ignore kanatype.
/// </summary>
public const uint NORM_IGNOREKANATYPE = 0x00010000;
/// <summary>
/// Ignore width.
/// </summary>
public const uint NORM_IGNOREWIDTH = 0x00020000;
/// <summary>
/// Treat punctuation the same as symbols.
/// </summary>
public const uint SORT_STRINGSORT = 0x00001000;
/// <summary>
/// Produce a normalized wide-character sort key.
/// </summary>
public const uint LCMAP_SORTKEY = 0x00000400;
#endregion Win32 Constants
}
}
}

View File

@ -0,0 +1,70 @@
//-----------------------------------------------------------------------
// <copyright file="DateTimeColumnValue.cs" company="Microsoft Corporation">
// Copyright (c) Microsoft Corporation.
// </copyright>
//-----------------------------------------------------------------------
namespace Microsoft.Isam.Esent.Interop
{
using System;
using System.Diagnostics;
/// <summary>
/// A <see cref="Guid"/> column value.
/// </summary>
public class DateTimeColumnValue : ColumnValueOfStruct<DateTime>
{
/// <summary>
/// Gets the size of the value in the column. This returns 0 for
/// variable sized columns (i.e. binary and string).
/// </summary>
protected override int Size
{
[DebuggerStepThrough]
get { return sizeof(double); }
}
/// <summary>
/// Recursive SetColumns method for data pinning. This populates the buffer and
/// calls the inherited SetColumns method.
/// </summary>
/// <param name="sesid">The session to use.</param>
/// <param name="tableid">
/// The table to set the columns in. An update should be prepared.
/// </param>
/// <param name="columnValues">
/// Column values to set.
/// </param>
/// <param name="nativeColumns">
/// Structures to put the pinned data in.
/// </param>
/// <param name="i">Offset of this object in the array.</param>
/// <returns>An error code.</returns>
internal override unsafe int SetColumns(JET_SESID sesid, JET_TABLEID tableid, ColumnValue[] columnValues, NATIVE_SETCOLUMN* nativeColumns, int i)
{
var data = this.Value.GetValueOrDefault().ToOADate();
return this.SetColumns(sesid, tableid, columnValues, nativeColumns, i, &data, sizeof(double), this.Value.HasValue);
}
/// <summary>
/// Given data retrieved from ESENT, decode the data and set the value in the ColumnValue object.
/// </summary>
/// <param name="value">An array of bytes.</param>
/// <param name="startIndex">The starting position within the bytes.</param>
/// <param name="count">The number of bytes to decode.</param>
/// <param name="err">The error returned from ESENT.</param>
protected override void GetValueFromBytes(byte[] value, int startIndex, int count, int err)
{
if (JET_wrn.ColumnNull == (JET_wrn)err)
{
this.Value = null;
}
else
{
this.CheckDataCount(count);
double d = BitConverter.ToDouble(value, startIndex);
this.Value = Conversions.ConvertDoubleToDateTime(d);
}
}
}
}

View File

@ -0,0 +1,69 @@
//-----------------------------------------------------------------------
// <copyright file="DoubleColumnValue.cs" company="Microsoft Corporation">
// Copyright (c) Microsoft Corporation.
// </copyright>
//-----------------------------------------------------------------------
namespace Microsoft.Isam.Esent.Interop
{
using System;
using System.Diagnostics;
/// <summary>
/// A <see cref="double"/> column value.
/// </summary>
public class DoubleColumnValue : ColumnValueOfStruct<double>
{
/// <summary>
/// Gets the size of the value in the column. This returns 0 for
/// variable sized columns (i.e. binary and string).
/// </summary>
protected override int Size
{
[DebuggerStepThrough]
get { return sizeof(double); }
}
/// <summary>
/// Recursive SetColumns method for data pinning. This populates the buffer and
/// calls the inherited SetColumns method.
/// </summary>
/// <param name="sesid">The session to use.</param>
/// <param name="tableid">
/// The table to set the columns in. An update should be prepared.
/// </param>
/// <param name="columnValues">
/// Column values to set.
/// </param>
/// <param name="nativeColumns">
/// Structures to put the pinned data in.
/// </param>
/// <param name="i">Offset of this object in the array.</param>
/// <returns>An error code.</returns>
internal override unsafe int SetColumns(JET_SESID sesid, JET_TABLEID tableid, ColumnValue[] columnValues, NATIVE_SETCOLUMN* nativeColumns, int i)
{
var data = this.Value.GetValueOrDefault();
return this.SetColumns(sesid, tableid, columnValues, nativeColumns, i, &data, sizeof(double), this.Value.HasValue);
}
/// <summary>
/// Given data retrieved from ESENT, decode the data and set the value in the ColumnValue object.
/// </summary>
/// <param name="value">An array of bytes.</param>
/// <param name="startIndex">The starting position within the bytes.</param>
/// <param name="count">The number of bytes to decode.</param>
/// <param name="err">The error returned from ESENT.</param>
protected override void GetValueFromBytes(byte[] value, int startIndex, int count, int err)
{
if (JET_wrn.ColumnNull == (JET_wrn)err)
{
this.Value = null;
}
else
{
this.CheckDataCount(count);
this.Value = BitConverter.ToDouble(value, startIndex);
}
}
}
}

View File

@ -0,0 +1,172 @@
// --------------------------------------------------------------------------------------------------------------------
// <copyright file="DurableCommitCallback.cs" company="Microsoft Corporation">
// Copyright (c) Microsoft Corporation.
// </copyright>
// <summary>
// Callback for JET_param JET_paramDurableCommitCallback.
// </summary>
// --------------------------------------------------------------------------------------------------------------------
namespace Microsoft.Isam.Esent.Interop.Windows8
{
using System;
using System.Diagnostics;
using System.Diagnostics.CodeAnalysis;
using System.Globalization;
using System.Reflection;
#if !MANAGEDESENT_ON_CORECLR
using System.Runtime.CompilerServices;
#endif
using Microsoft.Isam.Esent.Interop.Implementation;
/// <summary>
/// A class which wraps the callback dealing with durable commits.
/// </summary>
public class DurableCommitCallback : EsentResource
{
/// <summary>
/// API call tracing.
/// </summary>
private static readonly TraceSwitch TraceSwitch = new TraceSwitch("ESENT DurableCommitCallback", "Wrapper around unmanaged ESENT durable commit callback");
/// <summary>
/// Instance associated with this callback.
/// </summary>
private JET_INSTANCE instance;
/// <summary>
/// Hold a reference to the delegate so that it doesn't get garbage-collected.
/// </summary>
private JET_PFNDURABLECOMMITCALLBACK wrappedCallback;
/// <summary>
/// Hold a reference to the delegate so that it doesn't get garbage-collected.
/// </summary>
[SuppressMessage("Exchange.Performance", "EX0023:DeadVariableDetector", Justification = "Need to hold on to a reference to the callback, so that it does not get garbage collected.")]
private NATIVE_JET_PFNDURABLECOMMITCALLBACK wrapperCallback;
/// <summary>
/// Initializes a new instance of the <see cref="DurableCommitCallback"/> class.
/// The constructor.
/// </summary>
/// <param name="instance">
/// The instance with which to associate the callback.
/// </param>
/// <param name="wrappedCallback">
/// The managed code callback to call.
/// </param>
public DurableCommitCallback(
JET_INSTANCE instance,
JET_PFNDURABLECOMMITCALLBACK wrappedCallback)
{
this.instance = instance;
this.wrappedCallback = wrappedCallback;
this.wrapperCallback = this.NativeDurableCommitCallback;
#if !MANAGEDESENT_ON_WSA // RuntimeHelpers works differently in Windows Store Apps.
if (this.wrappedCallback != null)
{
RuntimeHelpers.PrepareMethod(this.wrappedCallback.Method.MethodHandle);
}
RuntimeHelpers.PrepareMethod(typeof(DurableCommitCallback).GetMethod("NativeDurableCommitCallback", BindingFlags.NonPublic | BindingFlags.Instance).MethodHandle);
#endif
InstanceParameters instanceParameters = new InstanceParameters(this.instance);
// This might be null.
instanceParameters.SetDurableCommitCallback(this.wrapperCallback);
this.ResourceWasAllocated();
}
/// <summary>
/// Generate a string representation of the structure.
/// </summary>
/// <returns>The structure as a string.</returns>
public override string ToString()
{
return string.Format(
CultureInfo.InvariantCulture,
"DurableCommitCallback({0})",
this.instance.ToString());
}
/// <summary>
/// Terminate the durable commit session.
/// </summary>
public void End()
{
this.CheckObjectIsNotDisposed();
this.ReleaseResource();
}
/// <summary>
/// Free the durable commit session.
/// We do not try to set the instance parameter to null, since the callback is disposed after JetTerm and
/// the callback cannot be set after JetTerm.
/// </summary>
protected override void ReleaseResource()
{
this.instance = JET_INSTANCE.Nil;
this.wrappedCallback = null;
this.wrapperCallback = null;
this.ResourceWasReleased();
}
/// <summary>
/// The proxy callback function to call the user-defined managed delegate.
/// </summary>
/// <param name="instance">
/// The instance.
/// </param>
/// <param name="commitIdSeen">
/// The commit-id flushed.
/// </param>
/// <param name="grbit">
/// Reserved currently.
/// </param>
/// <returns>
/// An error code.
/// </returns>
private JET_err NativeDurableCommitCallback(
IntPtr instance,
ref NATIVE_COMMIT_ID commitIdSeen,
uint grbit)
{
RuntimeHelpers.PrepareConstrainedRegions();
try
{
JET_INSTANCE jetInstance = new JET_INSTANCE()
{
Value = instance
};
if (this.instance != jetInstance)
{
// We assume it's only called on one instance at a time. The only thing
// we really care about is serialization of the byte array.
//
// It would be nice to throw an error, but we're going back to real
// code, which doesn't deal with managed exceptions well.
return JET_err.CallbackFailed;
}
JET_COMMIT_ID commitId = new JET_COMMIT_ID(commitIdSeen);
return this.wrappedCallback(jetInstance, commitId, (DurableCommitCallbackGrbit)grbit);
}
catch (Exception ex)
{
Trace.WriteLineIf(
TraceSwitch.TraceWarning, string.Format(CultureInfo.InvariantCulture, "Caught Exception {0}", ex));
JetApi.ReportUnhandledException(ex, "Unhandled exception during NativeDurableCommitCallback");
// This should never be executed, but the compiler doesn't know it.
return JET_err.CallbackFailed;
}
}
}
}

View File

@ -0,0 +1,121 @@
//-----------------------------------------------------------------------
// <copyright file="EnumeratedColumn.cs" company="Microsoft Corporation">
// Copyright (c) Microsoft Corporation.
// </copyright>
//-----------------------------------------------------------------------
namespace Microsoft.Isam.Esent.Interop
{
using System;
using System.Globalization;
/// <summary>
/// The values for a given column as generated by Api.EnumerateColumns.
/// </summary>
public class EnumeratedColumn
{
/// <summary>
/// Gets or sets the column ID of this set of column values.
/// </summary>
public JET_COLUMNID Id { get; set; }
/// <summary>
/// Gets or sets the status of this column id.
/// </summary>
/// <seealso cref="JET_err.Success"/>
/// <seealso cref="JET_err.BadColumnId"/>
/// <seealso cref="JET_err.ColumnNotFound"/>
public JET_err Error { get; set; }
/// <summary>
/// Gets or sets the status of this set of column values.
/// </summary>
/// <seealso cref="JET_wrn.Success"/>
/// <seealso cref="JET_wrn.ColumnDefault"/>
/// <seealso cref="JET_wrn.ColumnNull"/>
/// <seealso cref="JET_wrn.ColumnPresent"/>
/// <seealso cref="JET_wrn.ColumnSkipped"/>
public JET_wrn Warning { get; set; }
/// <summary>
/// Gets or sets the column values enumerated.
/// </summary>
/// <remarks>
/// This will be null if the column is null or the column values were not provided.
/// </remarks>
public Value[] Values { get; set; }
/// <summary>
/// Returns a <see cref="T:System.String"/> that represents the current <see cref="EnumeratedColumn"/>.
/// </summary>
/// <returns>
/// A <see cref="T:System.String"/> that represents the current <see cref="EnumeratedColumn"/>.
/// </returns>
public override string ToString()
{
return string.Format(
CultureInfo.InvariantCulture,
"EnumeratedColumn(0x{0:x}: {1} Values[{2}])",
this.Id,
this.Error != JET_err.Success ? this.Error.ToString() : this.Warning.ToString(),
this.Values.Length);
}
/// <summary>
/// A single column value.
/// </summary>
public class Value
{
/// <summary>
/// Gets or sets the ordinal of this column value.
/// </summary>
/// <remarks>
/// The lowest valid ordinal is one.
/// This is the same as the "itagSequence" of the column value.
/// </remarks>
public int Ordinal { get; set; }
/// <summary>
/// Gets or sets the status of this column value.
/// </summary>
/// <seealso cref="JET_wrn.Success"/>
/// <seealso cref="JET_wrn.ColumnDefault"/>
/// <seealso cref="JET_wrn.ColumnNotInRecord"/>
/// <seealso cref="JET_wrn.ColumnNull"/>
/// <seealso cref="JET_wrn.ColumnPresent"/>
/// <seealso cref="JET_wrn.ColumnSkipped"/>
/// <seealso cref="JET_wrn.ColumnTruncated"/>
public JET_wrn Warning { get; set; }
/// <summary>
/// Gets or sets the column value as bytes.
/// </summary>
/// <remarks>
/// This will be null if the column is null or the column values were not provided.
/// This will be truncated if Warning is <see cref="JET_wrn.ColumnTruncated"/>.
/// </remarks>
public byte[] Bytes { get; set; }
/// <summary>
/// Returns a <see cref="T:System.String"/> that represents the current <see cref="EnumeratedColumn.Value"/>.
/// </summary>
/// <returns>
/// A <see cref="T:System.String"/> that represents the current <see cref="EnumeratedColumn.Value"/>.
/// </returns>
public override string ToString()
{
const int MaxLength = 16;
return string.Format(
CultureInfo.InvariantCulture,
"EnumeratedColumn.Value({0}: {1} Bytes[{2}] = {3}{4}{5}{6})",
this.Ordinal,
this.Warning,
this.Bytes.Length,
'{',
BitConverter.ToString(this.Bytes, 0, Math.Min(this.Bytes.Length, MaxLength)),
this.Bytes.Length > MaxLength ? "..." : string.Empty,
'}');
}
}
}
}

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,351 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.10.35122.118
MinimumVisualStudioVersion = 10.0.40219.1
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{18B3E50E-454E-49DB-A92F-E1D7DAD2AF7D}"
ProjectSection(SolutionItems) = preProject
CodeCoverage.testrunconfig = CodeCoverage.testrunconfig
esent.vsmdi = esent.vsmdi
Normal.testrunconfig = Normal.testrunconfig
EndProjectSection
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EsentInterop", "EsentInterop.csproj", "{E929E163-52A0-4AAC-917B-6D7FAF70C45E}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DbUtil", "..\EsentInteropSamples\DbUtil\DbUtil.csproj", "{E0B163B0-5AC6-4304-B932-BFC1F6A2A4EB}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "isam", "..\isam\isam.csproj", "{21CC632C-B09A-4DB7-BD6E-7F7D2716F58F}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "StockSample", "..\EsentInteropSamples\StockSample\StockSample.csproj", "{B0E6D3AB-26F8-4A77-A7E1-D8024B8FFFCF}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EsentCollections", "..\EsentCollections\EsentCollections.csproj", "{CF2D4EE4-0D11-404D-B800-C4DCFEC42588}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "HelloWorld", "..\EsentCollectionsSamples\HelloWorld\HelloWorld.csproj", "{8341DE8C-5BC7-461F-B42D-AA2B72586A5C}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "RssDictionarySample", "..\EsentCollectionsSamples\RssDictionarySample\RssDictionarySample.csproj", "{134FBC80-2E23-451B-A6B3-72B0AA2234F9}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EsentInteropTests", "..\EsentInteropTests\EsentInteropTests.csproj", "{85B2B7BB-BF95-42DF-8CBF-348AEF63BD1F}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EsentCollectionsTests", "..\EsentCollectionsTests\EsentCollectionsTests.csproj", "{D3A1C1C8-6119-4827-AC24-1FF49FACFD4D}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "IsamUnitTests", "..\isamunittests\IsamUnitTests.csproj", "{6AC9C0BE-6BCE-493F-BD80-6F2247CB669D}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DbUtilTests", "..\EsentInteropSamples\DbUtilTests\DbUtilTests.csproj", "{C9B82A4F-8306-41A9-91DA-1BA5080F1DB0}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EsentSample", "..\EsentInteropSamples\EsentSample\EsentSample.csproj", "{44D46916-891F-435F-B914-AE8AC80613FD}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BasicTest", "..\EsentInteropSamples\BasicTest\BasicTest.csproj", "{08819B49-02B8-4F93-A143-F9B0461CEA64}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UWPSample", "..\UWPSample\UWPSample.csproj", "{B1427E8D-9175-42BE-8B90-A5A9CB4AAD51}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Debug|ARM = Debug|ARM
Debug|ARM64 = Debug|ARM64
Debug|x64 = Debug|x64
Debug|x86 = Debug|x86
Release|Any CPU = Release|Any CPU
Release|ARM = Release|ARM
Release|ARM64 = Release|ARM64
Release|x64 = Release|x64
Release|x86 = Release|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{E929E163-52A0-4AAC-917B-6D7FAF70C45E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{E929E163-52A0-4AAC-917B-6D7FAF70C45E}.Debug|Any CPU.Build.0 = Debug|Any CPU
{E929E163-52A0-4AAC-917B-6D7FAF70C45E}.Debug|ARM.ActiveCfg = Debug|Any CPU
{E929E163-52A0-4AAC-917B-6D7FAF70C45E}.Debug|ARM.Build.0 = Debug|Any CPU
{E929E163-52A0-4AAC-917B-6D7FAF70C45E}.Debug|ARM64.ActiveCfg = Debug|Any CPU
{E929E163-52A0-4AAC-917B-6D7FAF70C45E}.Debug|ARM64.Build.0 = Debug|Any CPU
{E929E163-52A0-4AAC-917B-6D7FAF70C45E}.Debug|x64.ActiveCfg = Debug|Any CPU
{E929E163-52A0-4AAC-917B-6D7FAF70C45E}.Debug|x64.Build.0 = Debug|Any CPU
{E929E163-52A0-4AAC-917B-6D7FAF70C45E}.Debug|x86.ActiveCfg = Debug|Any CPU
{E929E163-52A0-4AAC-917B-6D7FAF70C45E}.Debug|x86.Build.0 = Debug|Any CPU
{E929E163-52A0-4AAC-917B-6D7FAF70C45E}.Release|Any CPU.ActiveCfg = Release|Any CPU
{E929E163-52A0-4AAC-917B-6D7FAF70C45E}.Release|Any CPU.Build.0 = Release|Any CPU
{E929E163-52A0-4AAC-917B-6D7FAF70C45E}.Release|ARM.ActiveCfg = Release|Any CPU
{E929E163-52A0-4AAC-917B-6D7FAF70C45E}.Release|ARM.Build.0 = Release|Any CPU
{E929E163-52A0-4AAC-917B-6D7FAF70C45E}.Release|ARM64.ActiveCfg = Release|Any CPU
{E929E163-52A0-4AAC-917B-6D7FAF70C45E}.Release|ARM64.Build.0 = Release|Any CPU
{E929E163-52A0-4AAC-917B-6D7FAF70C45E}.Release|x64.ActiveCfg = Release|Any CPU
{E929E163-52A0-4AAC-917B-6D7FAF70C45E}.Release|x64.Build.0 = Release|Any CPU
{E929E163-52A0-4AAC-917B-6D7FAF70C45E}.Release|x86.ActiveCfg = Release|x86
{E929E163-52A0-4AAC-917B-6D7FAF70C45E}.Release|x86.Build.0 = Release|x86
{E0B163B0-5AC6-4304-B932-BFC1F6A2A4EB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{E0B163B0-5AC6-4304-B932-BFC1F6A2A4EB}.Debug|Any CPU.Build.0 = Debug|Any CPU
{E0B163B0-5AC6-4304-B932-BFC1F6A2A4EB}.Debug|ARM.ActiveCfg = Debug|Any CPU
{E0B163B0-5AC6-4304-B932-BFC1F6A2A4EB}.Debug|ARM.Build.0 = Debug|Any CPU
{E0B163B0-5AC6-4304-B932-BFC1F6A2A4EB}.Debug|ARM64.ActiveCfg = Debug|Any CPU
{E0B163B0-5AC6-4304-B932-BFC1F6A2A4EB}.Debug|ARM64.Build.0 = Debug|Any CPU
{E0B163B0-5AC6-4304-B932-BFC1F6A2A4EB}.Debug|x64.ActiveCfg = Debug|Any CPU
{E0B163B0-5AC6-4304-B932-BFC1F6A2A4EB}.Debug|x64.Build.0 = Debug|Any CPU
{E0B163B0-5AC6-4304-B932-BFC1F6A2A4EB}.Debug|x86.ActiveCfg = Debug|Any CPU
{E0B163B0-5AC6-4304-B932-BFC1F6A2A4EB}.Debug|x86.Build.0 = Debug|Any CPU
{E0B163B0-5AC6-4304-B932-BFC1F6A2A4EB}.Release|Any CPU.ActiveCfg = Release|Any CPU
{E0B163B0-5AC6-4304-B932-BFC1F6A2A4EB}.Release|Any CPU.Build.0 = Release|Any CPU
{E0B163B0-5AC6-4304-B932-BFC1F6A2A4EB}.Release|ARM.ActiveCfg = Release|Any CPU
{E0B163B0-5AC6-4304-B932-BFC1F6A2A4EB}.Release|ARM.Build.0 = Release|Any CPU
{E0B163B0-5AC6-4304-B932-BFC1F6A2A4EB}.Release|ARM64.ActiveCfg = Release|Any CPU
{E0B163B0-5AC6-4304-B932-BFC1F6A2A4EB}.Release|ARM64.Build.0 = Release|Any CPU
{E0B163B0-5AC6-4304-B932-BFC1F6A2A4EB}.Release|x64.ActiveCfg = Release|Any CPU
{E0B163B0-5AC6-4304-B932-BFC1F6A2A4EB}.Release|x64.Build.0 = Release|Any CPU
{E0B163B0-5AC6-4304-B932-BFC1F6A2A4EB}.Release|x86.ActiveCfg = Release|x86
{E0B163B0-5AC6-4304-B932-BFC1F6A2A4EB}.Release|x86.Build.0 = Release|x86
{21CC632C-B09A-4DB7-BD6E-7F7D2716F58F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{21CC632C-B09A-4DB7-BD6E-7F7D2716F58F}.Debug|Any CPU.Build.0 = Debug|Any CPU
{21CC632C-B09A-4DB7-BD6E-7F7D2716F58F}.Debug|ARM.ActiveCfg = Debug|Any CPU
{21CC632C-B09A-4DB7-BD6E-7F7D2716F58F}.Debug|ARM.Build.0 = Debug|Any CPU
{21CC632C-B09A-4DB7-BD6E-7F7D2716F58F}.Debug|ARM64.ActiveCfg = Debug|Any CPU
{21CC632C-B09A-4DB7-BD6E-7F7D2716F58F}.Debug|ARM64.Build.0 = Debug|Any CPU
{21CC632C-B09A-4DB7-BD6E-7F7D2716F58F}.Debug|x64.ActiveCfg = Debug|Any CPU
{21CC632C-B09A-4DB7-BD6E-7F7D2716F58F}.Debug|x64.Build.0 = Debug|Any CPU
{21CC632C-B09A-4DB7-BD6E-7F7D2716F58F}.Debug|x86.ActiveCfg = Debug|Any CPU
{21CC632C-B09A-4DB7-BD6E-7F7D2716F58F}.Debug|x86.Build.0 = Debug|Any CPU
{21CC632C-B09A-4DB7-BD6E-7F7D2716F58F}.Release|Any CPU.ActiveCfg = Release|Any CPU
{21CC632C-B09A-4DB7-BD6E-7F7D2716F58F}.Release|Any CPU.Build.0 = Release|Any CPU
{21CC632C-B09A-4DB7-BD6E-7F7D2716F58F}.Release|ARM.ActiveCfg = Release|Any CPU
{21CC632C-B09A-4DB7-BD6E-7F7D2716F58F}.Release|ARM.Build.0 = Release|Any CPU
{21CC632C-B09A-4DB7-BD6E-7F7D2716F58F}.Release|ARM64.ActiveCfg = Release|Any CPU
{21CC632C-B09A-4DB7-BD6E-7F7D2716F58F}.Release|ARM64.Build.0 = Release|Any CPU
{21CC632C-B09A-4DB7-BD6E-7F7D2716F58F}.Release|x64.ActiveCfg = Release|Any CPU
{21CC632C-B09A-4DB7-BD6E-7F7D2716F58F}.Release|x64.Build.0 = Release|Any CPU
{21CC632C-B09A-4DB7-BD6E-7F7D2716F58F}.Release|x86.ActiveCfg = Release|x86
{21CC632C-B09A-4DB7-BD6E-7F7D2716F58F}.Release|x86.Build.0 = Release|x86
{B0E6D3AB-26F8-4A77-A7E1-D8024B8FFFCF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{B0E6D3AB-26F8-4A77-A7E1-D8024B8FFFCF}.Debug|Any CPU.Build.0 = Debug|Any CPU
{B0E6D3AB-26F8-4A77-A7E1-D8024B8FFFCF}.Debug|ARM.ActiveCfg = Debug|Any CPU
{B0E6D3AB-26F8-4A77-A7E1-D8024B8FFFCF}.Debug|ARM.Build.0 = Debug|Any CPU
{B0E6D3AB-26F8-4A77-A7E1-D8024B8FFFCF}.Debug|ARM64.ActiveCfg = Debug|Any CPU
{B0E6D3AB-26F8-4A77-A7E1-D8024B8FFFCF}.Debug|ARM64.Build.0 = Debug|Any CPU
{B0E6D3AB-26F8-4A77-A7E1-D8024B8FFFCF}.Debug|x64.ActiveCfg = Debug|Any CPU
{B0E6D3AB-26F8-4A77-A7E1-D8024B8FFFCF}.Debug|x64.Build.0 = Debug|Any CPU
{B0E6D3AB-26F8-4A77-A7E1-D8024B8FFFCF}.Debug|x86.ActiveCfg = Debug|Any CPU
{B0E6D3AB-26F8-4A77-A7E1-D8024B8FFFCF}.Debug|x86.Build.0 = Debug|Any CPU
{B0E6D3AB-26F8-4A77-A7E1-D8024B8FFFCF}.Release|Any CPU.ActiveCfg = Release|Any CPU
{B0E6D3AB-26F8-4A77-A7E1-D8024B8FFFCF}.Release|Any CPU.Build.0 = Release|Any CPU
{B0E6D3AB-26F8-4A77-A7E1-D8024B8FFFCF}.Release|ARM.ActiveCfg = Release|Any CPU
{B0E6D3AB-26F8-4A77-A7E1-D8024B8FFFCF}.Release|ARM.Build.0 = Release|Any CPU
{B0E6D3AB-26F8-4A77-A7E1-D8024B8FFFCF}.Release|ARM64.ActiveCfg = Release|Any CPU
{B0E6D3AB-26F8-4A77-A7E1-D8024B8FFFCF}.Release|ARM64.Build.0 = Release|Any CPU
{B0E6D3AB-26F8-4A77-A7E1-D8024B8FFFCF}.Release|x64.ActiveCfg = Release|Any CPU
{B0E6D3AB-26F8-4A77-A7E1-D8024B8FFFCF}.Release|x64.Build.0 = Release|Any CPU
{B0E6D3AB-26F8-4A77-A7E1-D8024B8FFFCF}.Release|x86.ActiveCfg = Release|x86
{B0E6D3AB-26F8-4A77-A7E1-D8024B8FFFCF}.Release|x86.Build.0 = Release|x86
{CF2D4EE4-0D11-404D-B800-C4DCFEC42588}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{CF2D4EE4-0D11-404D-B800-C4DCFEC42588}.Debug|Any CPU.Build.0 = Debug|Any CPU
{CF2D4EE4-0D11-404D-B800-C4DCFEC42588}.Debug|ARM.ActiveCfg = Debug|Any CPU
{CF2D4EE4-0D11-404D-B800-C4DCFEC42588}.Debug|ARM.Build.0 = Debug|Any CPU
{CF2D4EE4-0D11-404D-B800-C4DCFEC42588}.Debug|ARM64.ActiveCfg = Debug|Any CPU
{CF2D4EE4-0D11-404D-B800-C4DCFEC42588}.Debug|ARM64.Build.0 = Debug|Any CPU
{CF2D4EE4-0D11-404D-B800-C4DCFEC42588}.Debug|x64.ActiveCfg = Debug|Any CPU
{CF2D4EE4-0D11-404D-B800-C4DCFEC42588}.Debug|x64.Build.0 = Debug|Any CPU
{CF2D4EE4-0D11-404D-B800-C4DCFEC42588}.Debug|x86.ActiveCfg = Debug|Any CPU
{CF2D4EE4-0D11-404D-B800-C4DCFEC42588}.Debug|x86.Build.0 = Debug|Any CPU
{CF2D4EE4-0D11-404D-B800-C4DCFEC42588}.Release|Any CPU.ActiveCfg = Release|Any CPU
{CF2D4EE4-0D11-404D-B800-C4DCFEC42588}.Release|Any CPU.Build.0 = Release|Any CPU
{CF2D4EE4-0D11-404D-B800-C4DCFEC42588}.Release|ARM.ActiveCfg = Release|Any CPU
{CF2D4EE4-0D11-404D-B800-C4DCFEC42588}.Release|ARM.Build.0 = Release|Any CPU
{CF2D4EE4-0D11-404D-B800-C4DCFEC42588}.Release|ARM64.ActiveCfg = Release|Any CPU
{CF2D4EE4-0D11-404D-B800-C4DCFEC42588}.Release|ARM64.Build.0 = Release|Any CPU
{CF2D4EE4-0D11-404D-B800-C4DCFEC42588}.Release|x64.ActiveCfg = Release|Any CPU
{CF2D4EE4-0D11-404D-B800-C4DCFEC42588}.Release|x64.Build.0 = Release|Any CPU
{CF2D4EE4-0D11-404D-B800-C4DCFEC42588}.Release|x86.ActiveCfg = Release|x86
{CF2D4EE4-0D11-404D-B800-C4DCFEC42588}.Release|x86.Build.0 = Release|x86
{8341DE8C-5BC7-461F-B42D-AA2B72586A5C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{8341DE8C-5BC7-461F-B42D-AA2B72586A5C}.Debug|Any CPU.Build.0 = Debug|Any CPU
{8341DE8C-5BC7-461F-B42D-AA2B72586A5C}.Debug|ARM.ActiveCfg = Debug|Any CPU
{8341DE8C-5BC7-461F-B42D-AA2B72586A5C}.Debug|ARM.Build.0 = Debug|Any CPU
{8341DE8C-5BC7-461F-B42D-AA2B72586A5C}.Debug|ARM64.ActiveCfg = Debug|Any CPU
{8341DE8C-5BC7-461F-B42D-AA2B72586A5C}.Debug|ARM64.Build.0 = Debug|Any CPU
{8341DE8C-5BC7-461F-B42D-AA2B72586A5C}.Debug|x64.ActiveCfg = Debug|Any CPU
{8341DE8C-5BC7-461F-B42D-AA2B72586A5C}.Debug|x64.Build.0 = Debug|Any CPU
{8341DE8C-5BC7-461F-B42D-AA2B72586A5C}.Debug|x86.ActiveCfg = Debug|Any CPU
{8341DE8C-5BC7-461F-B42D-AA2B72586A5C}.Debug|x86.Build.0 = Debug|Any CPU
{8341DE8C-5BC7-461F-B42D-AA2B72586A5C}.Release|Any CPU.ActiveCfg = Release|Any CPU
{8341DE8C-5BC7-461F-B42D-AA2B72586A5C}.Release|Any CPU.Build.0 = Release|Any CPU
{8341DE8C-5BC7-461F-B42D-AA2B72586A5C}.Release|ARM.ActiveCfg = Release|Any CPU
{8341DE8C-5BC7-461F-B42D-AA2B72586A5C}.Release|ARM.Build.0 = Release|Any CPU
{8341DE8C-5BC7-461F-B42D-AA2B72586A5C}.Release|ARM64.ActiveCfg = Release|Any CPU
{8341DE8C-5BC7-461F-B42D-AA2B72586A5C}.Release|ARM64.Build.0 = Release|Any CPU
{8341DE8C-5BC7-461F-B42D-AA2B72586A5C}.Release|x64.ActiveCfg = Release|Any CPU
{8341DE8C-5BC7-461F-B42D-AA2B72586A5C}.Release|x64.Build.0 = Release|Any CPU
{8341DE8C-5BC7-461F-B42D-AA2B72586A5C}.Release|x86.ActiveCfg = Release|x86
{8341DE8C-5BC7-461F-B42D-AA2B72586A5C}.Release|x86.Build.0 = Release|x86
{134FBC80-2E23-451B-A6B3-72B0AA2234F9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{134FBC80-2E23-451B-A6B3-72B0AA2234F9}.Debug|Any CPU.Build.0 = Debug|Any CPU
{134FBC80-2E23-451B-A6B3-72B0AA2234F9}.Debug|ARM.ActiveCfg = Debug|Any CPU
{134FBC80-2E23-451B-A6B3-72B0AA2234F9}.Debug|ARM.Build.0 = Debug|Any CPU
{134FBC80-2E23-451B-A6B3-72B0AA2234F9}.Debug|ARM64.ActiveCfg = Debug|Any CPU
{134FBC80-2E23-451B-A6B3-72B0AA2234F9}.Debug|ARM64.Build.0 = Debug|Any CPU
{134FBC80-2E23-451B-A6B3-72B0AA2234F9}.Debug|x64.ActiveCfg = Debug|Any CPU
{134FBC80-2E23-451B-A6B3-72B0AA2234F9}.Debug|x64.Build.0 = Debug|Any CPU
{134FBC80-2E23-451B-A6B3-72B0AA2234F9}.Debug|x86.ActiveCfg = Debug|Any CPU
{134FBC80-2E23-451B-A6B3-72B0AA2234F9}.Debug|x86.Build.0 = Debug|Any CPU
{134FBC80-2E23-451B-A6B3-72B0AA2234F9}.Release|Any CPU.ActiveCfg = Release|Any CPU
{134FBC80-2E23-451B-A6B3-72B0AA2234F9}.Release|Any CPU.Build.0 = Release|Any CPU
{134FBC80-2E23-451B-A6B3-72B0AA2234F9}.Release|ARM.ActiveCfg = Release|Any CPU
{134FBC80-2E23-451B-A6B3-72B0AA2234F9}.Release|ARM.Build.0 = Release|Any CPU
{134FBC80-2E23-451B-A6B3-72B0AA2234F9}.Release|ARM64.ActiveCfg = Release|Any CPU
{134FBC80-2E23-451B-A6B3-72B0AA2234F9}.Release|ARM64.Build.0 = Release|Any CPU
{134FBC80-2E23-451B-A6B3-72B0AA2234F9}.Release|x64.ActiveCfg = Release|Any CPU
{134FBC80-2E23-451B-A6B3-72B0AA2234F9}.Release|x64.Build.0 = Release|Any CPU
{134FBC80-2E23-451B-A6B3-72B0AA2234F9}.Release|x86.ActiveCfg = Release|x86
{134FBC80-2E23-451B-A6B3-72B0AA2234F9}.Release|x86.Build.0 = Release|x86
{85B2B7BB-BF95-42DF-8CBF-348AEF63BD1F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{85B2B7BB-BF95-42DF-8CBF-348AEF63BD1F}.Debug|Any CPU.Build.0 = Debug|Any CPU
{85B2B7BB-BF95-42DF-8CBF-348AEF63BD1F}.Debug|ARM.ActiveCfg = Debug|Any CPU
{85B2B7BB-BF95-42DF-8CBF-348AEF63BD1F}.Debug|ARM.Build.0 = Debug|Any CPU
{85B2B7BB-BF95-42DF-8CBF-348AEF63BD1F}.Debug|ARM64.ActiveCfg = Debug|Any CPU
{85B2B7BB-BF95-42DF-8CBF-348AEF63BD1F}.Debug|ARM64.Build.0 = Debug|Any CPU
{85B2B7BB-BF95-42DF-8CBF-348AEF63BD1F}.Debug|x64.ActiveCfg = Debug|Any CPU
{85B2B7BB-BF95-42DF-8CBF-348AEF63BD1F}.Debug|x64.Build.0 = Debug|Any CPU
{85B2B7BB-BF95-42DF-8CBF-348AEF63BD1F}.Debug|x86.ActiveCfg = Debug|Any CPU
{85B2B7BB-BF95-42DF-8CBF-348AEF63BD1F}.Debug|x86.Build.0 = Debug|Any CPU
{85B2B7BB-BF95-42DF-8CBF-348AEF63BD1F}.Release|Any CPU.ActiveCfg = Release|Any CPU
{85B2B7BB-BF95-42DF-8CBF-348AEF63BD1F}.Release|Any CPU.Build.0 = Release|Any CPU
{85B2B7BB-BF95-42DF-8CBF-348AEF63BD1F}.Release|ARM.ActiveCfg = Release|Any CPU
{85B2B7BB-BF95-42DF-8CBF-348AEF63BD1F}.Release|ARM.Build.0 = Release|Any CPU
{85B2B7BB-BF95-42DF-8CBF-348AEF63BD1F}.Release|ARM64.ActiveCfg = Release|Any CPU
{85B2B7BB-BF95-42DF-8CBF-348AEF63BD1F}.Release|ARM64.Build.0 = Release|Any CPU
{85B2B7BB-BF95-42DF-8CBF-348AEF63BD1F}.Release|x64.ActiveCfg = Release|Any CPU
{85B2B7BB-BF95-42DF-8CBF-348AEF63BD1F}.Release|x64.Build.0 = Release|Any CPU
{85B2B7BB-BF95-42DF-8CBF-348AEF63BD1F}.Release|x86.ActiveCfg = Release|x86
{85B2B7BB-BF95-42DF-8CBF-348AEF63BD1F}.Release|x86.Build.0 = Release|x86
{D3A1C1C8-6119-4827-AC24-1FF49FACFD4D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{D3A1C1C8-6119-4827-AC24-1FF49FACFD4D}.Debug|Any CPU.Build.0 = Debug|Any CPU
{D3A1C1C8-6119-4827-AC24-1FF49FACFD4D}.Debug|ARM.ActiveCfg = Debug|Any CPU
{D3A1C1C8-6119-4827-AC24-1FF49FACFD4D}.Debug|ARM.Build.0 = Debug|Any CPU
{D3A1C1C8-6119-4827-AC24-1FF49FACFD4D}.Debug|ARM64.ActiveCfg = Debug|Any CPU
{D3A1C1C8-6119-4827-AC24-1FF49FACFD4D}.Debug|ARM64.Build.0 = Debug|Any CPU
{D3A1C1C8-6119-4827-AC24-1FF49FACFD4D}.Debug|x64.ActiveCfg = Debug|Any CPU
{D3A1C1C8-6119-4827-AC24-1FF49FACFD4D}.Debug|x64.Build.0 = Debug|Any CPU
{D3A1C1C8-6119-4827-AC24-1FF49FACFD4D}.Debug|x86.ActiveCfg = Debug|Any CPU
{D3A1C1C8-6119-4827-AC24-1FF49FACFD4D}.Debug|x86.Build.0 = Debug|Any CPU
{D3A1C1C8-6119-4827-AC24-1FF49FACFD4D}.Release|Any CPU.ActiveCfg = Release|Any CPU
{D3A1C1C8-6119-4827-AC24-1FF49FACFD4D}.Release|Any CPU.Build.0 = Release|Any CPU
{D3A1C1C8-6119-4827-AC24-1FF49FACFD4D}.Release|ARM.ActiveCfg = Release|Any CPU
{D3A1C1C8-6119-4827-AC24-1FF49FACFD4D}.Release|ARM.Build.0 = Release|Any CPU
{D3A1C1C8-6119-4827-AC24-1FF49FACFD4D}.Release|ARM64.ActiveCfg = Release|Any CPU
{D3A1C1C8-6119-4827-AC24-1FF49FACFD4D}.Release|ARM64.Build.0 = Release|Any CPU
{D3A1C1C8-6119-4827-AC24-1FF49FACFD4D}.Release|x64.ActiveCfg = Release|Any CPU
{D3A1C1C8-6119-4827-AC24-1FF49FACFD4D}.Release|x64.Build.0 = Release|Any CPU
{D3A1C1C8-6119-4827-AC24-1FF49FACFD4D}.Release|x86.ActiveCfg = Release|x86
{D3A1C1C8-6119-4827-AC24-1FF49FACFD4D}.Release|x86.Build.0 = Release|x86
{6AC9C0BE-6BCE-493F-BD80-6F2247CB669D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{6AC9C0BE-6BCE-493F-BD80-6F2247CB669D}.Debug|Any CPU.Build.0 = Debug|Any CPU
{6AC9C0BE-6BCE-493F-BD80-6F2247CB669D}.Debug|ARM.ActiveCfg = Debug|Any CPU
{6AC9C0BE-6BCE-493F-BD80-6F2247CB669D}.Debug|ARM.Build.0 = Debug|Any CPU
{6AC9C0BE-6BCE-493F-BD80-6F2247CB669D}.Debug|ARM64.ActiveCfg = Debug|Any CPU
{6AC9C0BE-6BCE-493F-BD80-6F2247CB669D}.Debug|ARM64.Build.0 = Debug|Any CPU
{6AC9C0BE-6BCE-493F-BD80-6F2247CB669D}.Debug|x64.ActiveCfg = Debug|Any CPU
{6AC9C0BE-6BCE-493F-BD80-6F2247CB669D}.Debug|x64.Build.0 = Debug|Any CPU
{6AC9C0BE-6BCE-493F-BD80-6F2247CB669D}.Debug|x86.ActiveCfg = Debug|Any CPU
{6AC9C0BE-6BCE-493F-BD80-6F2247CB669D}.Debug|x86.Build.0 = Debug|Any CPU
{6AC9C0BE-6BCE-493F-BD80-6F2247CB669D}.Release|Any CPU.ActiveCfg = Debug|Any CPU
{6AC9C0BE-6BCE-493F-BD80-6F2247CB669D}.Release|Any CPU.Build.0 = Debug|Any CPU
{6AC9C0BE-6BCE-493F-BD80-6F2247CB669D}.Release|ARM.ActiveCfg = Release|Any CPU
{6AC9C0BE-6BCE-493F-BD80-6F2247CB669D}.Release|ARM.Build.0 = Release|Any CPU
{6AC9C0BE-6BCE-493F-BD80-6F2247CB669D}.Release|ARM64.ActiveCfg = Release|Any CPU
{6AC9C0BE-6BCE-493F-BD80-6F2247CB669D}.Release|ARM64.Build.0 = Release|Any CPU
{6AC9C0BE-6BCE-493F-BD80-6F2247CB669D}.Release|x64.ActiveCfg = Release|Any CPU
{6AC9C0BE-6BCE-493F-BD80-6F2247CB669D}.Release|x64.Build.0 = Release|Any CPU
{6AC9C0BE-6BCE-493F-BD80-6F2247CB669D}.Release|x86.ActiveCfg = Release|x86
{6AC9C0BE-6BCE-493F-BD80-6F2247CB669D}.Release|x86.Build.0 = Release|x86
{C9B82A4F-8306-41A9-91DA-1BA5080F1DB0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{C9B82A4F-8306-41A9-91DA-1BA5080F1DB0}.Debug|Any CPU.Build.0 = Debug|Any CPU
{C9B82A4F-8306-41A9-91DA-1BA5080F1DB0}.Debug|ARM.ActiveCfg = Debug|Any CPU
{C9B82A4F-8306-41A9-91DA-1BA5080F1DB0}.Debug|ARM.Build.0 = Debug|Any CPU
{C9B82A4F-8306-41A9-91DA-1BA5080F1DB0}.Debug|ARM64.ActiveCfg = Debug|Any CPU
{C9B82A4F-8306-41A9-91DA-1BA5080F1DB0}.Debug|ARM64.Build.0 = Debug|Any CPU
{C9B82A4F-8306-41A9-91DA-1BA5080F1DB0}.Debug|x64.ActiveCfg = Debug|Any CPU
{C9B82A4F-8306-41A9-91DA-1BA5080F1DB0}.Debug|x64.Build.0 = Debug|Any CPU
{C9B82A4F-8306-41A9-91DA-1BA5080F1DB0}.Debug|x86.ActiveCfg = Debug|Any CPU
{C9B82A4F-8306-41A9-91DA-1BA5080F1DB0}.Debug|x86.Build.0 = Debug|Any CPU
{C9B82A4F-8306-41A9-91DA-1BA5080F1DB0}.Release|Any CPU.ActiveCfg = Release|Any CPU
{C9B82A4F-8306-41A9-91DA-1BA5080F1DB0}.Release|Any CPU.Build.0 = Release|Any CPU
{C9B82A4F-8306-41A9-91DA-1BA5080F1DB0}.Release|ARM.ActiveCfg = Release|Any CPU
{C9B82A4F-8306-41A9-91DA-1BA5080F1DB0}.Release|ARM.Build.0 = Release|Any CPU
{C9B82A4F-8306-41A9-91DA-1BA5080F1DB0}.Release|ARM64.ActiveCfg = Release|Any CPU
{C9B82A4F-8306-41A9-91DA-1BA5080F1DB0}.Release|ARM64.Build.0 = Release|Any CPU
{C9B82A4F-8306-41A9-91DA-1BA5080F1DB0}.Release|x64.ActiveCfg = Release|Any CPU
{C9B82A4F-8306-41A9-91DA-1BA5080F1DB0}.Release|x64.Build.0 = Release|Any CPU
{C9B82A4F-8306-41A9-91DA-1BA5080F1DB0}.Release|x86.ActiveCfg = Release|x86
{C9B82A4F-8306-41A9-91DA-1BA5080F1DB0}.Release|x86.Build.0 = Release|x86
{44D46916-891F-435F-B914-AE8AC80613FD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{44D46916-891F-435F-B914-AE8AC80613FD}.Debug|Any CPU.Build.0 = Debug|Any CPU
{44D46916-891F-435F-B914-AE8AC80613FD}.Debug|ARM.ActiveCfg = Debug|Any CPU
{44D46916-891F-435F-B914-AE8AC80613FD}.Debug|ARM.Build.0 = Debug|Any CPU
{44D46916-891F-435F-B914-AE8AC80613FD}.Debug|ARM64.ActiveCfg = Debug|Any CPU
{44D46916-891F-435F-B914-AE8AC80613FD}.Debug|ARM64.Build.0 = Debug|Any CPU
{44D46916-891F-435F-B914-AE8AC80613FD}.Debug|x64.ActiveCfg = Debug|Any CPU
{44D46916-891F-435F-B914-AE8AC80613FD}.Debug|x64.Build.0 = Debug|Any CPU
{44D46916-891F-435F-B914-AE8AC80613FD}.Debug|x86.ActiveCfg = Debug|Any CPU
{44D46916-891F-435F-B914-AE8AC80613FD}.Debug|x86.Build.0 = Debug|Any CPU
{44D46916-891F-435F-B914-AE8AC80613FD}.Release|Any CPU.ActiveCfg = Release|Any CPU
{44D46916-891F-435F-B914-AE8AC80613FD}.Release|Any CPU.Build.0 = Release|Any CPU
{44D46916-891F-435F-B914-AE8AC80613FD}.Release|ARM.ActiveCfg = Release|Any CPU
{44D46916-891F-435F-B914-AE8AC80613FD}.Release|ARM.Build.0 = Release|Any CPU
{44D46916-891F-435F-B914-AE8AC80613FD}.Release|ARM64.ActiveCfg = Release|Any CPU
{44D46916-891F-435F-B914-AE8AC80613FD}.Release|ARM64.Build.0 = Release|Any CPU
{44D46916-891F-435F-B914-AE8AC80613FD}.Release|x64.ActiveCfg = Release|Any CPU
{44D46916-891F-435F-B914-AE8AC80613FD}.Release|x64.Build.0 = Release|Any CPU
{44D46916-891F-435F-B914-AE8AC80613FD}.Release|x86.ActiveCfg = Release|x86
{44D46916-891F-435F-B914-AE8AC80613FD}.Release|x86.Build.0 = Release|x86
{08819B49-02B8-4F93-A143-F9B0461CEA64}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{08819B49-02B8-4F93-A143-F9B0461CEA64}.Debug|Any CPU.Build.0 = Debug|Any CPU
{08819B49-02B8-4F93-A143-F9B0461CEA64}.Debug|ARM.ActiveCfg = Debug|Any CPU
{08819B49-02B8-4F93-A143-F9B0461CEA64}.Debug|ARM.Build.0 = Debug|Any CPU
{08819B49-02B8-4F93-A143-F9B0461CEA64}.Debug|ARM64.ActiveCfg = Debug|Any CPU
{08819B49-02B8-4F93-A143-F9B0461CEA64}.Debug|ARM64.Build.0 = Debug|Any CPU
{08819B49-02B8-4F93-A143-F9B0461CEA64}.Debug|x64.ActiveCfg = Debug|Any CPU
{08819B49-02B8-4F93-A143-F9B0461CEA64}.Debug|x64.Build.0 = Debug|Any CPU
{08819B49-02B8-4F93-A143-F9B0461CEA64}.Debug|x86.ActiveCfg = Debug|Any CPU
{08819B49-02B8-4F93-A143-F9B0461CEA64}.Debug|x86.Build.0 = Debug|Any CPU
{08819B49-02B8-4F93-A143-F9B0461CEA64}.Release|Any CPU.ActiveCfg = Release|Any CPU
{08819B49-02B8-4F93-A143-F9B0461CEA64}.Release|Any CPU.Build.0 = Release|Any CPU
{08819B49-02B8-4F93-A143-F9B0461CEA64}.Release|ARM.ActiveCfg = Release|Any CPU
{08819B49-02B8-4F93-A143-F9B0461CEA64}.Release|ARM.Build.0 = Release|Any CPU
{08819B49-02B8-4F93-A143-F9B0461CEA64}.Release|ARM64.ActiveCfg = Release|Any CPU
{08819B49-02B8-4F93-A143-F9B0461CEA64}.Release|ARM64.Build.0 = Release|Any CPU
{08819B49-02B8-4F93-A143-F9B0461CEA64}.Release|x64.ActiveCfg = Release|Any CPU
{08819B49-02B8-4F93-A143-F9B0461CEA64}.Release|x64.Build.0 = Release|Any CPU
{08819B49-02B8-4F93-A143-F9B0461CEA64}.Release|x86.ActiveCfg = Release|x86
{08819B49-02B8-4F93-A143-F9B0461CEA64}.Release|x86.Build.0 = Release|x86
{B1427E8D-9175-42BE-8B90-A5A9CB4AAD51}.Debug|Any CPU.ActiveCfg = Debug|x86
{B1427E8D-9175-42BE-8B90-A5A9CB4AAD51}.Debug|ARM.ActiveCfg = Debug|ARM
{B1427E8D-9175-42BE-8B90-A5A9CB4AAD51}.Debug|ARM.Build.0 = Debug|ARM
{B1427E8D-9175-42BE-8B90-A5A9CB4AAD51}.Debug|ARM.Deploy.0 = Debug|ARM
{B1427E8D-9175-42BE-8B90-A5A9CB4AAD51}.Debug|ARM64.ActiveCfg = Debug|ARM64
{B1427E8D-9175-42BE-8B90-A5A9CB4AAD51}.Debug|ARM64.Build.0 = Debug|ARM64
{B1427E8D-9175-42BE-8B90-A5A9CB4AAD51}.Debug|ARM64.Deploy.0 = Debug|ARM64
{B1427E8D-9175-42BE-8B90-A5A9CB4AAD51}.Debug|x64.ActiveCfg = Debug|x64
{B1427E8D-9175-42BE-8B90-A5A9CB4AAD51}.Debug|x64.Build.0 = Debug|x64
{B1427E8D-9175-42BE-8B90-A5A9CB4AAD51}.Debug|x64.Deploy.0 = Debug|x64
{B1427E8D-9175-42BE-8B90-A5A9CB4AAD51}.Debug|x86.ActiveCfg = Debug|x86
{B1427E8D-9175-42BE-8B90-A5A9CB4AAD51}.Debug|x86.Build.0 = Debug|x86
{B1427E8D-9175-42BE-8B90-A5A9CB4AAD51}.Debug|x86.Deploy.0 = Debug|x86
{B1427E8D-9175-42BE-8B90-A5A9CB4AAD51}.Release|Any CPU.ActiveCfg = Release|x86
{B1427E8D-9175-42BE-8B90-A5A9CB4AAD51}.Release|ARM.ActiveCfg = Release|ARM
{B1427E8D-9175-42BE-8B90-A5A9CB4AAD51}.Release|ARM.Build.0 = Release|ARM
{B1427E8D-9175-42BE-8B90-A5A9CB4AAD51}.Release|ARM.Deploy.0 = Release|ARM
{B1427E8D-9175-42BE-8B90-A5A9CB4AAD51}.Release|ARM64.ActiveCfg = Release|ARM64
{B1427E8D-9175-42BE-8B90-A5A9CB4AAD51}.Release|ARM64.Build.0 = Release|ARM64
{B1427E8D-9175-42BE-8B90-A5A9CB4AAD51}.Release|ARM64.Deploy.0 = Release|ARM64
{B1427E8D-9175-42BE-8B90-A5A9CB4AAD51}.Release|x64.ActiveCfg = Release|x64
{B1427E8D-9175-42BE-8B90-A5A9CB4AAD51}.Release|x64.Build.0 = Release|x64
{B1427E8D-9175-42BE-8B90-A5A9CB4AAD51}.Release|x64.Deploy.0 = Release|x64
{B1427E8D-9175-42BE-8B90-A5A9CB4AAD51}.Release|x86.ActiveCfg = Release|x86
{B1427E8D-9175-42BE-8B90-A5A9CB4AAD51}.Release|x86.Build.0 = Release|x86
{B1427E8D-9175-42BE-8B90-A5A9CB4AAD51}.Release|x86.Deploy.0 = Release|x86
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {6A6764EF-3A8F-46BF-8CC8-C07DE889160A}
EndGlobalSection
GlobalSection(TestCaseManagementSettings) = postSolution
CategoryFile = Esent.vsmdi
EndGlobalSection
EndGlobal

View File

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<TestLists xmlns="http://microsoft.com/schemas/VisualStudio/TeamTest/2010">
<TestList name="Lists of Tests" id="8c43106b-9dc1-4907-a29f-aa66a61bf5b6">
<RunConfiguration id="6c3d561f-b13d-4563-9e69-90f00c61747b" name="Normal" storage="normal.testrunconfig" type="Microsoft.VisualStudio.TestTools.Common.TestRunConfiguration, Microsoft.VisualStudio.QualityTools.Common, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
</TestList>
</TestLists>

View File

@ -0,0 +1 @@
<?xml version="1.0" encoding="utf-8"?><ItemProperties xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><Properties><Property><Name>svn:mime-type</Name><Value>application/octet-stream</Value></Property></Properties></ItemProperties>

View File

@ -0,0 +1,82 @@
//-----------------------------------------------------------------------
// <copyright file="AssemblyInfo.cs" company="Microsoft Corporation">
// Copyright (c) Microsoft Corporation.
// </copyright>
//-----------------------------------------------------------------------
using System;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("EsentInterop")]
[assembly: AssemblyDescription("Managed interop code for esent.dll")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Microsoft")]
[assembly: AssemblyProduct("EsentInterop")]
[assembly: AssemblyCopyright("Copyright (c) Microsoft")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
[assembly: CLSCompliant(true)]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
//
// Version history:
// 1.6.0.0
// 1.7.0.0
// 1.8.0.0 Support new Windows user interface (As of Win8 Beta build).
// 1.8.1.0 2012.11.18. Some minor updates, including some perf updates.
// 1.8.2.0 2012.11.19. Signed.
// 1.8.3.0 2013.03.25. Signed and Strong Named. Renamed 'Metro' to 'Wsa' (Windows Store App)
// 1.8.4.0 2013.12.23. Updated for Windows 8.1.
// 1.9.0.0 2013.12.23. Go back to targetting framework 4.0.
// 1.9.1.0 2014.07.18. PersistentDictionary gets binary blobs; added Isam layer.
// 1.9.2.0 2014.09.11. Isam is placed in the Microsoft.Database namespace.
// 1.9.3.0 2015.08.11. Dependence added from Collections to Isam dll for configsets.
// 1.9.3.2 2015.09.02. Some bug fixes; go back to Framework 4.0
// 1.9.3.3 2016.03.01. Some bug and perf fixes.
// 1.9.4 2016.06.28. Some bug fixes.
// 1.9.4.1 2017.08.30. Adding JetGetIndexInfo that returns JET_INDEXCREATE.
[assembly: AssemblyVersion("1.9.4.1")]
[assembly: AssemblyFileVersion("1.9.4.1")]
#if STRONG_NAMED
[assembly: InternalsVisibleTo("EsentInteropWsaTests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100B5FC90E7027F67871E773A8FDE8938C81DD402BA65B9201D60593E96C492651E889CC13F1415EBB53FAC1131AE0BD333C5EE6021672D9718EA31A8AEBD0DA0072F25D87DBA6FC90FFD598ED4DA35E44C398C454307E8E33B8426143DAEC9F596836F97C8F74750E5975C64E2189F45DEF46B2A2B1247ADC3652BF5C308055DA9")]
[assembly: InternalsVisibleTo("Esent.Isam, PublicKey=0024000004800000940000000602000000240000525341310004000001000100B5FC90E7027F67871E773A8FDE8938C81DD402BA65B9201D60593E96C492651E889CC13F1415EBB53FAC1131AE0BD333C5EE6021672D9718EA31A8AEBD0DA0072F25D87DBA6FC90FFD598ED4DA35E44C398C454307E8E33B8426143DAEC9F596836F97C8F74750E5975C64E2189F45DEF46B2A2B1247ADC3652BF5C308055DA9")]
[assembly: InternalsVisibleTo("InteropApiTests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100B5FC90E7027F67871E773A8FDE8938C81DD402BA65B9201D60593E96C492651E889CC13F1415EBB53FAC1131AE0BD333C5EE6021672D9718EA31A8AEBD0DA0072F25D87DBA6FC90FFD598ED4DA35E44C398C454307E8E33B8426143DAEC9F596836F97C8F74750E5975C64E2189F45DEF46B2A2B1247ADC3652BF5C308055DA9")]
[assembly: InternalsVisibleTo("IsamUnitTests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100B5FC90E7027F67871E773A8FDE8938C81DD402BA65B9201D60593E96C492651E889CC13F1415EBB53FAC1131AE0BD333C5EE6021672D9718EA31A8AEBD0DA0072F25D87DBA6FC90FFD598ED4DA35E44C398C454307E8E33B8426143DAEC9F596836F97C8F74750E5975C64E2189F45DEF46B2A2B1247ADC3652BF5C308055DA9")]
[assembly: InternalsVisibleTo("Pixie, PublicKey=0024000004800000940000000602000000240000525341310004000001000100B5FC90E7027F67871E773A8FDE8938C81DD402BA65B9201D60593E96C492651E889CC13F1415EBB53FAC1131AE0BD333C5EE6021672D9718EA31A8AEBD0DA0072F25D87DBA6FC90FFD598ED4DA35E44C398C454307E8E33B8426143DAEC9F596836F97C8F74750E5975C64E2189F45DEF46B2A2B1247ADC3652BF5C308055DA9")]
[assembly: InternalsVisibleTo("PixieTests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100B5FC90E7027F67871E773A8FDE8938C81DD402BA65B9201D60593E96C492651E889CC13F1415EBB53FAC1131AE0BD333C5EE6021672D9718EA31A8AEBD0DA0072F25D87DBA6FC90FFD598ED4DA35E44C398C454307E8E33B8426143DAEC9F596836F97C8F74750E5975C64E2189F45DEF46B2A2B1247ADC3652BF5C308055DA9")]
// This assembly is generated by Rhino.Mocks
[assembly: InternalsVisibleTo("DynamicProxyGenAssembly2,PublicKey=0024000004800000940000000602000000240000525341310004000001000100c547cac37abd99c8db225ef2f6c8a3602f3b3606cc9891605d02baa56104f4cfc0734aa39b93bf7852f7d9266654753cc297e7d2edfe0bac1cdcf9f717241550e0a7b191195b7667bb4f64bcb8e2121380fd1d9d46ad2d92d2d15605093924cceaf74c4861eff62abf69b9291ed0a340e113be11e6a7d3113e92484cf7045cc7")]
#else
[assembly: InternalsVisibleTo("InteropApiTests")]
[assembly: InternalsVisibleTo("IsamUnitTests")]
[assembly: InternalsVisibleTo("EsentInteropTestsImmersive")]
[assembly: InternalsVisibleTo("EsentInteropWsaTests")]
[assembly: InternalsVisibleTo("Esent.Isam")]
[assembly: InternalsVisibleTo("Pixie")]
[assembly: InternalsVisibleTo("PixieTests")]
// This assembly is generated by Rhino.Mocks
[assembly: InternalsVisibleTo("DynamicProxyGenAssembly2")]
#endif

View File

@ -0,0 +1,37 @@
//-----------------------------------------------------------------------
// <copyright file="CallbackDataConverter.cs" company="Microsoft Corporation">
// Copyright (c) Microsoft Corporation.
// </copyright>
//-----------------------------------------------------------------------
namespace Microsoft.Isam.Esent.Interop
{
using System;
using System.Runtime.InteropServices;
/// <summary>
/// Methods to convert data objects used in callbacks.
/// </summary>
internal static class CallbackDataConverter
{
/// <summary>
/// Get the managed data object from the unmanaged data.
/// </summary>
/// <param name="nativeData">The native data.</param>
/// <param name="snp">The SNP (used to determine the type of object).</param>
/// <param name="snt">The SNT (used to determine the type of object).</param>
/// <returns>The managed data object.</returns>
public static object GetManagedData(IntPtr nativeData, JET_SNP snp, JET_SNT snt)
{
if (IntPtr.Zero != nativeData && JET_SNT.Progress == snt)
{
NATIVE_SNPROG native = (NATIVE_SNPROG)Marshal.PtrToStructure(nativeData, typeof(NATIVE_SNPROG));
JET_SNPROG managed = new JET_SNPROG();
managed.SetFromNative(native);
return managed;
}
return null;
}
}
}

View File

@ -0,0 +1,263 @@
//-----------------------------------------------------------------------
// <copyright file="EsentImplementationStubs.cs" company="Microsoft Corporation">
// Copyright (c) Microsoft Corporation.
// </copyright>
// <summary>
// Class stubs to allow compiling on CoreClr.
// </summary>
//-----------------------------------------------------------------------
namespace Microsoft.Isam.Esent.Interop.Implementation
{
using System;
using System.Diagnostics;
using System.Diagnostics.CodeAnalysis;
using System.Text;
/// <summary>
/// A fake class to allow compilation on platforms that lack this functionality.
/// </summary>
[SuppressMessage("StyleCop.CSharp.MaintainabilityRules", "SA1402:FileMayOnlyContainASingleClass",
Justification = "Reviewed. Suppression is OK here because it's a collection of trivial classes.")]
public class Trace
{
/// <summary>
/// A fake function to allow compilation on platforms that lack this functionality.
/// </summary>
/// <param name="condition">
/// The condition.
/// </param>
/// <param name="message">
/// The message.
/// </param>
[ConditionalAttribute("TRACE")]
public static void WriteLineIf(bool condition, string message)
{
}
/// <summary>
/// A fake function to allow compilation on platforms that lack this functionality.
/// </summary>
/// <param name="condition">
/// The condition.
/// </param>
/// <param name="message">
/// The message.
/// </param>
[ConditionalAttribute("TRACE")]
public static void WriteLineIf(bool condition, object message)
{
}
/// <summary>
/// Prints out the object's contents.
/// </summary>
/// <returns>A string represenetation or the object.</returns>
public override string ToString()
{
return base.ToString();
}
}
/// <summary>
/// A fake class to allow compilation on platforms that lack this class.
/// </summary>
[SuppressMessage("StyleCop.CSharp.MaintainabilityRules", "SA1402:FileMayOnlyContainASingleClass",
Justification = "Reviewed. Suppression is OK here because it's a collection of trivial classes.")]
internal static class RuntimeHelpers
{
/// <summary>
/// A fake function to allow compilation on platforms that lack this functionality.
/// </summary>
public static void PrepareConstrainedRegions()
{
}
/// <summary>
/// A fake function to allow compilation on platforms that lack this functionality.
/// </summary>
/// <param name="method">
/// The method.
/// </param>
public static void PrepareMethod(RuntimeMethodHandle method)
{
}
}
/// <summary>
/// Ascii encoding is not available on Core Clr. But UTF-8 is.
/// This class will reject any character that results in an
/// extended value.
/// </summary>
[SuppressMessage("StyleCop.CSharp.MaintainabilityRules", "SA1402:FileMayOnlyContainASingleClass",
Justification = "Reviewed. Suppression is OK here because it's a collection of trivial classes.")]
internal class SlowAsciiEncoding : UTF8Encoding
{
/// <summary>
/// The standard encoding object.
/// </summary>
private static SlowAsciiEncoding slowAsciiEncoding = new SlowAsciiEncoding();
/// <summary>
/// Gets an Encoding object.
/// </summary>
public static Encoding Encoding
{
get
{
return slowAsciiEncoding;
}
}
#if !MANAGEDESENT_ON_WSA
/// <summary>
/// Converts a string to the byte representation.
/// </summary>
/// <param name="chars">
/// The chars.
/// </param>
/// <param name="charCount">
/// The char count.
/// </param>
/// <param name="bytes">
/// The bytes.
/// </param>
/// <param name="byteCount">
/// The byte count.
/// </param>
/// <returns>
/// A count of bytes stored.
/// </returns>
public override unsafe int GetBytes(char* chars, int charCount, byte* bytes, int byteCount)
{
IntPtr toFree;
char* charsToTranslate = this.SanitizeString(chars, charCount, out toFree);
int toReturn = base.GetBytes(charsToTranslate, charCount, bytes, byteCount);
LibraryHelpers.MarshalFreeHGlobal(toFree);
return toReturn;
}
#endif
/// <summary>
/// Converts a string to the byte representation.
/// </summary>
/// <param name="inputString">
/// The input string.
/// </param>
/// <returns>
/// The byte representation of the string.
/// </returns>
public override byte[] GetBytes(string inputString)
{
string stringToTranslate = this.SanitizeString(inputString);
return base.GetBytes(stringToTranslate);
}
/// <summary>
/// Converts a string to the byte representation.
/// </summary>
/// <param name="inputString">
/// The input string.
/// </param>
/// <param name="charIndex">
/// The char index.
/// </param>
/// <param name="charCount">
/// The char count.
/// </param>
/// <param name="bytes">
/// The bytes.
/// </param>
/// <param name="byteIndex">
/// The byte index.
/// </param>
/// <returns>
/// The byte representation of the string.
/// </returns>
public override int GetBytes(string inputString, int charIndex, int charCount, byte[] bytes, int byteIndex)
{
string stringToTranslate = this.SanitizeString(inputString);
return base.GetBytes(stringToTranslate, charIndex, charCount, bytes, byteIndex);
}
/// <summary>
/// Scans the string looking for unmappable characters in the ASCII set, and replaces
/// them with '?'.
/// </summary>
/// <param name="inputString">A unicode string with unknown characters.</param>
/// <returns>A string that has all legal ASCII characters.</returns>
private string SanitizeString(string inputString)
{
bool needToDuplicate = false;
string returnString = inputString;
foreach (char ch in inputString)
{
if (ch > 127)
{
needToDuplicate = true;
break;
}
}
if (needToDuplicate)
{
StringBuilder sb = new StringBuilder(inputString.Length);
foreach (char ch in inputString)
{
sb.Append(ch > 127 ? '?' : ch);
}
returnString = sb.ToString();
}
return returnString;
}
#if !MANAGEDESENT_ON_WSA
/// <summary>
/// Scans the string looking for unmappable characters in the ASCII set, and replaces
/// them with '?'.
/// </summary>
/// <param name="inputString">A unicode string with unknown characters.</param>
/// <param name="charCount">The length of the string to sanitize.</param>
/// <param name="allocedMemory">On output, a value that needs to be freed. Only used
/// if there are any untranslaable characters.</param>
/// <returns>A string that has all legal ASCII characters.</returns>
private unsafe char* SanitizeString(char* inputString, int charCount, out IntPtr allocedMemory)
{
allocedMemory = IntPtr.Zero;
bool needToDuplicate = false;
char* returnString = inputString;
for (int i = 0; i < charCount; ++i)
{
if (inputString[i] > 127)
{
needToDuplicate = true;
break;
}
}
if (needToDuplicate)
{
allocedMemory = LibraryHelpers.MarshalAllocHGlobal(charCount);
returnString = (char*)allocedMemory;
char* dest = returnString;
for (int i = 0; i < charCount; ++i)
{
dest[i] = inputString[i] > 127 ? '?' : inputString[i];
}
}
return returnString;
}
#endif
}
}

View File

@ -0,0 +1,157 @@
//-----------------------------------------------------------------------
// <copyright file="EsentJetApi.cs" company="Microsoft Corporation">
// Copyright (c) Microsoft Corporation.
// </copyright>
// <summary>
// JetApi code that is specific to ESENT.
// </summary>
//-----------------------------------------------------------------------
namespace Microsoft.Isam.Esent.Interop.Implementation
{
using System;
using System.Diagnostics;
using System.Globalization;
using System.Runtime.CompilerServices;
using System.Threading;
/// <summary>
/// JetApi code that is specific to ESENT.
/// </summary>
internal sealed partial class JetApi
{
/// <summary>
/// Reports the exception to a central authority.
/// </summary>
/// <param name="exception">An unhandled exception.</param>
/// <param name="description">A string description of the scenario.</param>
internal static void ReportUnhandledException(
Exception exception,
string description)
{
}
/// <summary>
/// Calculates the capabilities of the current Esent version.
/// </summary>
private void DetermineCapabilities()
{
const int Server2003BuildNumber = 2700;
const int VistaBuildNumber = 6000;
const int Windows7BuildNumber = 7000; // includes beta as well as RTM (RTM is 7600)
const int Windows8BuildNumber = 8000; // includes beta as well as RTM (RTM is 9200)
const int Windows81BuildNumber = 9300; // includes beta as well as RTM (RTM is 9600)
const int Windows10BuildNumber = 9900; // includes beta as well as RTM (RTM is 10240)
// Create new capabilities, set as all false. This will allow
// us to call into Esent.
this.Capabilities = new JetCapabilities { ColumnsKeyMost = 12 };
var version = this.versionOverride;
if (version == 0)
{
version = this.GetVersionFromEsent();
}
var buildNumber = (int)((version & 0xFFFFFF) >> 8);
Trace.WriteLineIf(
TraceSwitch.TraceVerbose,
string.Format(CultureInfo.InvariantCulture, "Version = {0}, BuildNumber = {1}", version, buildNumber));
if (buildNumber >= Server2003BuildNumber)
{
Trace.WriteLineIf(TraceSwitch.TraceVerbose, "Supports Server 2003 features");
this.Capabilities.SupportsServer2003Features = true;
}
if (buildNumber >= VistaBuildNumber)
{
Trace.WriteLineIf(TraceSwitch.TraceVerbose, "Supports Vista features");
this.Capabilities.SupportsVistaFeatures = true;
Trace.WriteLineIf(TraceSwitch.TraceVerbose, "Supports Unicode paths");
this.Capabilities.SupportsUnicodePaths = true;
Trace.WriteLineIf(TraceSwitch.TraceVerbose, "Supports large keys");
this.Capabilities.SupportsLargeKeys = true;
Trace.WriteLineIf(TraceSwitch.TraceVerbose, "Supports 16-column keys");
this.Capabilities.ColumnsKeyMost = 16;
}
if (buildNumber >= Windows7BuildNumber)
{
Trace.WriteLineIf(TraceSwitch.TraceVerbose, "Supports Windows 7 features");
this.Capabilities.SupportsWindows7Features = true;
}
if (buildNumber >= Windows8BuildNumber)
{
Trace.WriteLineIf(TraceSwitch.TraceVerbose, "Supports Windows 8 features");
this.Capabilities.SupportsWindows8Features = true;
}
if (buildNumber >= Windows81BuildNumber)
{
Trace.WriteLineIf(TraceSwitch.TraceVerbose, "Supports Windows 8.1 features");
this.Capabilities.SupportsWindows81Features = true;
}
if (buildNumber >= Windows10BuildNumber)
{
Trace.WriteLineIf(TraceSwitch.TraceVerbose, "Supports Windows 10 features");
this.Capabilities.SupportsWindows10Features = true;
}
}
/// <summary>
/// Create an instance and get the current version of Esent.
/// </summary>
/// <returns>The current version of Esent.</returns>
private uint GetVersionFromEsent()
{
#if MANAGEDESENT_ON_WSA
// JetGetVersion isn't available in new Windows user interface, so we'll pretend it's always Win8:
return 8250 << 8;
#else
// Create a unique name so that multiple threads can call this simultaneously.
// This can happen if there are multiple AppDomains.
string instanceName = string.Format(CultureInfo.InvariantCulture, "GettingEsentVersion{0}", LibraryHelpers.GetCurrentManagedThreadId());
JET_INSTANCE instance = JET_INSTANCE.Nil;
RuntimeHelpers.PrepareConstrainedRegions();
try
{
this.JetCreateInstance(out instance, instanceName);
this.JetSetSystemParameter(instance, JET_SESID.Nil, JET_param.Recovery, new IntPtr(0), "off");
this.JetSetSystemParameter(instance, JET_SESID.Nil, JET_param.NoInformationEvent, new IntPtr(1), null);
this.JetSetSystemParameter(instance, JET_SESID.Nil, JET_param.MaxTemporaryTables, new IntPtr(0), null);
this.JetSetSystemParameter(instance, JET_SESID.Nil, JET_param.MaxCursors, new IntPtr(16), null);
this.JetSetSystemParameter(instance, JET_SESID.Nil, JET_param.MaxOpenTables, new IntPtr(16), null);
this.JetSetSystemParameter(instance, JET_SESID.Nil, JET_param.MaxVerPages, new IntPtr(4), null);
this.JetSetSystemParameter(instance, JET_SESID.Nil, JET_param.MaxSessions, new IntPtr(1), null);
this.JetInit(ref instance);
JET_SESID sesid;
this.JetBeginSession(instance, out sesid, string.Empty, string.Empty);
try
{
uint version;
this.JetGetVersion(sesid, out version);
return version;
}
finally
{
this.JetEndSession(sesid, EndSessionGrbit.None);
}
}
finally
{
if (JET_INSTANCE.Nil != instance)
{
this.JetTerm(instance);
}
}
#endif
}
}
}

View File

@ -0,0 +1,22 @@
//-----------------------------------------------------------------------
// <copyright file="EsentNativeMethods.cs" company="Microsoft Corporation">
// Copyright (c) Microsoft Corporation.
// </copyright>
// <summary>
// NativeMethods code that is specific to ESENT.
// </summary>
//-----------------------------------------------------------------------
namespace Microsoft.Isam.Esent.Interop.Implementation
{
/// <summary>
/// Configuration for functions in esent.dll.
/// </summary>
internal static partial class NativeMethods
{
/// <summary>
/// The name of the DLL that the methods should be loaded from.
/// </summary>
private const string EsentDll = "esent.dll";
}
}

View File

@ -0,0 +1,325 @@
//-----------------------------------------------------------------------
// <copyright file="EsentStubAttributes.cs" company="Microsoft Corporation">
// Copyright (c) Microsoft Corporation.
// </copyright>
// <summary>
// Attribute stubs to allow compiling on CoreClr.
// </summary>
//-----------------------------------------------------------------------
namespace Microsoft.Isam.Esent.Interop
{
using System;
using System.Diagnostics.CodeAnalysis;
#if !MANAGEDESENT_ON_WSA
This file should only be compiled with MANAGEDESENT_ON_WSA
#endif
/// <summary>
/// A fake enumeration to allow compilation on platforms that lack this enumeration.
/// </summary>
public enum SecurityAction
{
/// <summary>
/// A fake enumeration to allow compilation on platforms that lack this enumeration.
/// </summary>
LinkDemand
}
/// <summary>
/// A fake attribute to allow compilation on platforms that lack this attribute.
/// </summary>
//// The real one inherits from System.Security.Permissions.CodeAccessSecurityAttribute.
[SerializableAttribute]
[ComVisibleAttribute(true)]
[AttributeUsageAttribute(
AttributeTargets.Assembly | AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Constructor
| AttributeTargets.Method, AllowMultiple = true, Inherited = false)]
internal sealed class SecurityPermissionAttribute : Attribute
{
/// <summary>
/// Initializes a new instance of the <see cref="SecurityPermissionAttribute"/> class.
/// </summary>
/// <param name="action">
/// The action.
/// </param>
public SecurityPermissionAttribute(
SecurityAction action)
{
}
/// <summary>
/// Prints out the object's contents.
/// </summary>
/// <returns>A string represenetation or the object.</returns>
public override string ToString()
{
return base.ToString();
}
}
/// <summary>
/// A fake attribute to allow compilation on platforms that lack this attribute.
/// </summary>
[ComVisibleAttribute(true)]
[AttributeUsageAttribute(AttributeTargets.Assembly | AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Interface, Inherited = false)]
[SuppressMessage("StyleCop.CSharp.MaintainabilityRules", "SA1402:FileMayOnlyContainASingleClass",
Justification = "Reviewed. Suppression is OK here because it's a collection of trivial classes.")]
[SuppressMessage(
"Microsoft.StyleCop.CSharp.MaintainabilityRules",
"SA1402:FileMayOnlyContainASingleClass",
Justification = "These stub classes are compiled only on some platforms that do not contain the entire framework, e.g. new Windows user interface.")]
internal sealed class BestFitMappingAttribute : Attribute
{
/// <summary>
/// Initializes a new instance of the <see cref="BestFitMappingAttribute"/> class.
/// </summary>
/// <param name="bestFitMapping">
/// The best fit mapping.
/// </param>
public BestFitMappingAttribute(
bool bestFitMapping)
{
}
/// <summary>
/// Gets or sets a value indicating whether ThrowOnUnmappableChar.
/// </summary>
public bool ThrowOnUnmappableChar
{
get;
set;
}
/// <summary>
/// Prints out the object's contents.
/// </summary>
/// <returns>A string represenetation or the object.</returns>
public override string ToString()
{
return base.ToString();
}
}
/// <summary>
/// A fake attribute to allow compilation on platforms that lack this attribute.
/// </summary>
[ComVisibleAttribute(true)]
[AttributeUsageAttribute(AttributeTargets.Class | AttributeTargets.Method | AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple = true,
Inherited = false)]
[SuppressMessage("StyleCop.CSharp.MaintainabilityRules", "SA1402:FileMayOnlyContainASingleClass",
Justification = "Reviewed. Suppression is OK here because it's a collection of trivial classes.")]
[SuppressMessage(
"Microsoft.StyleCop.CSharp.MaintainabilityRules",
"SA1402:FileMayOnlyContainASingleClass",
Justification = "These stub classes are compiled only on some platforms that do not contain the entire framework, e.g. new Windows user interface.")]
internal sealed class SuppressUnmanagedCodeSecurityAttribute : Attribute
{
/// <summary>
/// Prints out the object's contents.
/// </summary>
/// <returns>A string represenetation or the object.</returns>
public override string ToString()
{
return base.ToString();
}
}
/// <summary>
/// A fake attribute to allow compilation on platforms that lack this attribute.
/// </summary>
[AttributeUsageAttribute(AttributeTargets.Assembly | AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Enum | AttributeTargets.Method | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Interface | AttributeTargets.Delegate, Inherited = false)]
[ComVisibleAttribute(true)]
[SuppressMessage("StyleCop.CSharp.MaintainabilityRules", "SA1402:FileMayOnlyContainASingleClass",
Justification = "Reviewed. Suppression is OK here because it's a collection of trivial classes.")]
[SuppressMessage(
"Microsoft.StyleCop.CSharp.MaintainabilityRules",
"SA1402:FileMayOnlyContainASingleClass",
Justification = "These stub classes are compiled only on some platforms that do not contain the entire framework, e.g. new Windows user interface.")]
internal sealed class ComVisibleAttribute : Attribute
{
/// <summary>
/// Initializes a new instance of the <see cref="ComVisibleAttribute"/> class.
/// </summary>
/// <param name="comVisible">
/// The com visible.
/// </param>
public ComVisibleAttribute(bool comVisible)
{
}
/// <summary>
/// Prints out the object's contents.
/// </summary>
/// <returns>A string represenetation or the object.</returns>
public override string ToString()
{
return base.ToString();
}
}
/// <summary>
/// Indicates that a class can be serialized. This class cannot be inherited.
/// </summary>
/// <filterpriority>1</filterpriority>
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Enum | AttributeTargets.Delegate, Inherited = false), ComVisible(true)]
[SuppressMessage("StyleCop.CSharp.MaintainabilityRules", "SA1402:FileMayOnlyContainASingleClass",
Justification = "Reviewed. Suppression is OK here because it's a collection of trivial classes.")]
[SuppressMessage(
"Microsoft.StyleCop.CSharp.MaintainabilityRules",
"SA1402:FileMayOnlyContainASingleClass",
Justification = "These stub classes are compiled only on some platforms that do not contain the entire framework, e.g. new Windows user interface.")]
internal sealed class SerializableAttribute : Attribute
{
/// <summary>
/// Prints out the object's contents.
/// </summary>
/// <returns>A string represenetation or the object.</returns>
public override string ToString()
{
return base.ToString();
}
}
/// <summary>
/// Indicates that a field of a serializable class should not be serialized. This class cannot be inherited.
/// </summary>
/// <filterpriority>1</filterpriority>
[ComVisible(true), AttributeUsage(AttributeTargets.Field, Inherited = false)]
[SuppressMessage("StyleCop.CSharp.MaintainabilityRules", "SA1402:FileMayOnlyContainASingleClass",
Justification = "Reviewed. Suppression is OK here because it's a collection of trivial classes.")]
[SuppressMessage(
"Microsoft.StyleCop.CSharp.MaintainabilityRules",
"SA1402:FileMayOnlyContainASingleClass",
Justification = "These stub classes are compiled only on some platforms that do not contain the entire framework, e.g. new Windows user interface.")]
internal sealed class NonSerializedAttribute : Attribute
{
/// <summary>
/// Prints out the object's contents.
/// </summary>
/// <returns>A string represenetation or the object.</returns>
public override string ToString()
{
return base.ToString();
}
}
}
namespace System.Runtime.ConstrainedExecution
{
}
namespace System.Security.Cryptography
{
}
namespace System.Security.Permissions
{
}
namespace Microsoft.Win32.SafeHandles
{
}
namespace System.Runtime.ConstrainedExecution
{
using System;
using Microsoft.Isam.Esent.Interop;
/// <summary>
/// The consistency model. A stub.
/// </summary>
internal enum Consistency
{
/// <summary>
/// Might corrupt the process.
/// </summary>
MayCorruptProcess,
/// <summary>
/// Might corrupt the application domain.
/// </summary>
MayCorruptAppDomain,
/// <summary>
/// Might corrupt the instance.
/// </summary>
MayCorruptInstance,
/// <summary>
/// Will not corrupt the state.
/// </summary>
WillNotCorruptState,
}
/// <summary>
/// The Crticial Execution Region description. A stub.
/// </summary>
internal enum Cer
{
/// <summary>
/// No options.
/// </summary>
None,
/// <summary>
/// This might fail.
/// </summary>
MayFail,
/// <summary>
/// A successful CER.
/// </summary>
Success,
}
/// <summary>
/// The description of the reliability contract. A stub.
/// </summary>
internal sealed class ReliabilityContractAttribute : Attribute
{
/// <summary>
/// The consistency guarantee. A stub.
/// </summary>
private Consistency consistency;
/// <summary>
/// The critical execution region. A stub.
/// </summary>
private Cer cer;
/// <summary>
/// Initializes a new instance of the ReliabilityContractAttribute class. A stub.
/// </summary>
/// <param name="consistencyGuarantee">The guarantee of the consistency.</param>
/// <param name="cer">The critical execution region description.</param>
public ReliabilityContractAttribute(Consistency consistencyGuarantee, Cer cer)
{
this.consistency = consistencyGuarantee;
this.cer = cer;
}
/// <summary>
/// Gets the consistency guarantee. A stub.
/// </summary>
public Consistency ConsistencyGuarantee
{
get
{
return this.consistency;
}
}
/// <summary>
/// Gets the critical execution region. A stub.
/// </summary>
public Cer Cer
{
get
{
return this.cer;
}
}
}
}

View File

@ -0,0 +1,273 @@
//-----------------------------------------------------------------------
// <copyright file="EsentStubs.cs" company="Microsoft Corporation">
// Copyright (c) Microsoft Corporation.
// </copyright>
// <summary>
// Class stubs to allow compiling on CoreClr.
// </summary>
//-----------------------------------------------------------------------
namespace Microsoft.Isam.Esent.Interop
{
using System;
using System.Diagnostics;
using System.Diagnostics.CodeAnalysis;
/// <summary>
/// Some useful functionality that was omitted from Core CLR classes.
/// </summary>
[SuppressMessage(
"Microsoft.StyleCop.CSharp.MaintainabilityRules",
"SA1402:FileMayOnlyContainASingleClass",
Justification = "These stub classes are compiled only on some platforms that do not contain the entire framework, e.g. new Windows user interface.")]
public static class ExtensionsToCoreClr
{
/// <summary>Converts the value of this instance to the equivalent OLE Automation date.</summary>
/// <param name="dateTime">A DateTime structure.</param>
/// <returns>A double-precision floating-point number that contains an OLE Automation date equivalent to the value of this instance.</returns>
/// <exception cref="T:System.OverflowException">The value of this instance cannot be represented as an OLE Automation Date. </exception>
/// <filterpriority>2</filterpriority>
public static double ToOADate(this DateTime dateTime)
{
return LibraryHelpers.TicksToOADate(dateTime.Ticks);
}
}
/// <summary>
/// JetApi code that is specific to ESENT.
/// </summary>
[SuppressMessage(
"Microsoft.StyleCop.CSharp.MaintainabilityRules",
"SA1402:FileMayOnlyContainASingleClass",
Justification = "These stub classes are compiled only on some platforms that do not contain the entire framework, e.g. new Windows user interface.")]
public class SerializationInfo
{
/// <summary>
/// Prints out the object's contents.
/// </summary>
/// <returns>A string represenetation or the object.</returns>
public override string ToString()
{
return base.ToString();
}
/// <summary>
/// Deserializes an integer.
/// </summary>
/// <param name="propName">The name of the field to retrieve.</param>
/// <returns>An integer.</returns>
public int GetInt32(string propName)
{
return 0;
}
}
/// <summary>
/// A fake class to allow compilation on platforms that lack this class.
/// </summary>
[SuppressMessage("StyleCop.CSharp.MaintainabilityRules", "SA1402:FileMayOnlyContainASingleClass",
Justification = "Reviewed. Suppression is OK here because it's a collection of trivial classes.")]
[SuppressMessage(
"Microsoft.StyleCop.CSharp.MaintainabilityRules",
"SA1402:FileMayOnlyContainASingleClass",
Justification = "These stub classes are compiled only on some platforms that do not contain the entire framework, e.g. new Windows user interface.")]
internal static class RuntimeHelpers
{
/// <summary>
/// A fake function to allow compilation on platforms that lack this functionality.
/// </summary>
public static void PrepareConstrainedRegions()
{
}
/// <summary>
/// A fake function to allow compilation on platforms that lack this functionality.
/// </summary>
/// <param name="method">
/// The method.
/// </param>
public static void PrepareMethod(RuntimeMethodHandle method)
{
}
}
/// <summary>
/// A fake class to allow compilation on platforms that lack this class.
/// </summary>
[SuppressMessage("StyleCop.CSharp.MaintainabilityRules", "SA1402:FileMayOnlyContainASingleClass",
Justification = "Reviewed. Suppression is OK here because it's a collection of trivial classes.")]
internal class TraceSwitch
{
/// <summary>
/// Initializes a new instance of the <see cref="TraceSwitch"/> class.
/// </summary>
/// <param name="displayName">
/// The display name.
/// </param>
/// <param name="description">
/// The description.
/// </param>
public TraceSwitch(string displayName, string description)
{
}
/// <summary>
/// Gets a value indicating whether TraceVerbose.
/// </summary>
public bool TraceVerbose { get; private set; }
/// <summary>
/// Gets a value indicating whether TraceWarning.
/// </summary>
public bool TraceWarning { get; private set; }
/// <summary>
/// Gets a value indicating whether TraceError.
/// </summary>
public bool TraceError { get; private set; }
/// <summary>
/// Gets a value indicating whether TraceInfo.
/// </summary>
public bool TraceInfo { get; private set; }
/// <summary>
/// Prints out the object's contents.
/// </summary>
/// <returns>A string represenetation or the object.</returns>
public override string ToString()
{
return base.ToString();
}
}
/// <summary>
/// A fake class to allow compilation on platforms that lack this class.
/// </summary>
[SuppressMessage("StyleCop.CSharp.MaintainabilityRules", "SA1402:FileMayOnlyContainASingleClass",
Justification = "Reviewed. Suppression is OK here because it's a collection of trivial classes.")]
internal class Trace
{
/// <summary>
/// A fake function to allow compilation on platforms that lack this functionality.
/// </summary>
/// <param name="condition">
/// The condition.
/// </param>
/// <param name="message">
/// The message.
/// </param>
[ConditionalAttribute("TRACE")]
public static void WriteLineIf(bool condition, string message)
{
}
/// <summary>
/// A fake function to allow compilation on platforms that lack this functionality.
/// </summary>
/// <param name="message">
/// The message.
/// </param>
[ConditionalAttribute("TRACE")]
public static void TraceError(string message)
{
}
/// <summary>
/// A fake function to allow compilation on platforms that lack this functionality.
/// </summary>
/// <param name="message">
/// The message.
/// </param>
/// <param name="args">
/// The arguments.
/// </param>
[ConditionalAttribute("TRACE")]
public static void TraceWarning(string message, params object[] args)
{
}
}
}
#if MANAGEDESENT_ON_WSA
namespace System.ComponentModel
{
using System;
using System.Diagnostics.CodeAnalysis;
using System.Runtime.InteropServices;
using System.Security;
/// <summary>
/// An exception from a Win32 call.
/// </summary>
//// The original derives from System.Runtime.InteropServices.ExternalException.
internal class Win32Exception : Exception
{
/// <summary>
/// The error code from a Win32 call.
/// </summary>
private readonly int nativeErrorCode;
/// <summary>
/// Initializes a new instance of the Win32Exception class.
/// </summary>
[SecuritySafeCritical]
public Win32Exception() : this(Marshal.GetLastWin32Error())
{
}
/// <summary>
/// Initializes a new instance of the Win32Exception class.
/// </summary>
/// <param name="error">A win32 error code.</param>
[SecuritySafeCritical]
public Win32Exception(int error) : this(error, Win32Exception.GetErrorMessage(error))
{
}
/// <summary>
/// Initializes a new instance of the Win32Exception class.
/// </summary>
/// <param name="error">A win32 error code.</param>
/// <param name="message">The string message.</param>
public Win32Exception(int error, string message)
: base(message)
{
this.nativeErrorCode = error;
}
/// <summary>
/// Initializes a new instance of the Win32Exception class.
/// </summary>
/// <param name="message">The string message.</param>
[SecuritySafeCritical]
public Win32Exception(string message) : this(Marshal.GetLastWin32Error(), message)
{
}
/// <summary>
/// Initializes a new instance of the Win32Exception class.
/// </summary>
/// <param name="message">The string message.</param>
/// <param name="innerException">The nested exception.</param>
[SecuritySafeCritical, SuppressMessage("Microsoft.Interoperability", "CA1404:CallGetLastErrorImmediatelyAfterPInvoke", Justification = "Retuning error codes.")]
public Win32Exception(string message, Exception innerException) : base(message, innerException)
{
this.nativeErrorCode = Marshal.GetLastWin32Error();
}
/// <summary>
/// Returns a string value of the Win32 error code.
/// </summary>
/// <param name="error">The Win32 error code.</param>
/// <returns>A string representation.</returns>
[SecuritySafeCritical]
private static string GetErrorMessage(int error)
{
string result = string.Empty;
result = "Win32 error (0x" + Convert.ToString(error, 16) + ")";
return result;
}
}
}
#endif // MANAGEDESENT_ON_WSA

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,76 @@
//-----------------------------------------------------------------------
// <copyright file="EsentErrorException.cs" company="Microsoft Corporation">
// Copyright (c) Microsoft Corporation.
// </copyright>
//-----------------------------------------------------------------------
namespace Microsoft.Isam.Esent.Interop
{
using System;
using System.Runtime.Serialization;
/// <summary>
/// Base class for ESENT error exceptions.
/// </summary>
[Serializable]
public class EsentErrorException : EsentException
{
/// <summary>
/// The error code that was encountered.
/// </summary>
private JET_err errorCode;
/// <summary>
/// Initializes a new instance of the EsentErrorException class.
/// </summary>
/// <param name="message">The description of the error.</param>
/// <param name="err">The error code of the exception.</param>
internal EsentErrorException(string message, JET_err err) : base(message)
{
this.errorCode = err;
}
/// <summary>
/// Initializes a new instance of the EsentErrorException class. This constructor
/// is used to deserialize a serialized exception.
/// </summary>
/// <param name="info">The data needed to deserialize the object.</param>
/// <param name="context">The deserialization context.</param>
protected EsentErrorException(SerializationInfo info, StreamingContext context) :
base(info, context)
{
this.errorCode = (JET_err)info.GetInt32("errorCode");
}
/// <summary>
/// Gets the underlying Esent error for this exception.
/// </summary>
public JET_err Error
{
get
{
return this.errorCode;
}
}
#if !MANAGEDESENT_ON_CORECLR // Serialization does not work in Core CLR.
/// <summary>When overridden in a derived class, sets the <see cref="T:System.Runtime.Serialization.SerializationInfo" /> with information about the exception.</summary>
/// <param name="info">The <see cref="T:System.Runtime.Serialization.SerializationInfo" /> that holds the serialized object data about the exception being thrown. </param>
/// <param name="context">The <see cref="T:System.Runtime.Serialization.StreamingContext" /> that contains contextual information about the source or destination. </param>
/// <exception cref="T:System.ArgumentNullException">The <paramref name="info" /> parameter is a null reference (Nothing in Visual Basic). </exception>
/// <filterpriority>2</filterpriority>
/// <PermissionSet>
/// <IPermission class="System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Read="*AllFiles*" PathDiscovery="*AllFiles*" />
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="SerializationFormatter" />
/// </PermissionSet>
public override void GetObjectData(SerializationInfo info, StreamingContext context)
{
base.GetObjectData(info, context);
if (info != null)
{
info.AddValue("errorCode", this.errorCode, typeof(int));
}
}
#endif
}
}

View File

@ -0,0 +1,51 @@
//-----------------------------------------------------------------------
// <copyright file="EsentException.cs" company="Microsoft Corporation">
// Copyright (c) Microsoft Corporation.
// </copyright>
//-----------------------------------------------------------------------
namespace Microsoft.Isam.Esent
{
using System;
using System.Runtime.Serialization;
#if !MANAGEDESENT_SUPPORTS_SERIALIZATION && MANAGEDESENT_ON_WSA
using Microsoft.Isam.Esent.Interop;
using SerializableAttribute = Microsoft.Isam.Esent.Interop.SerializableAttribute;
#endif
/// <summary>
/// Base class for ESENT exceptions.
/// </summary>
[Serializable]
public abstract class EsentException : Exception
{
/// <summary>
/// Initializes a new instance of the EsentException class.
/// </summary>
protected EsentException()
{
}
/// <summary>
/// Initializes a new instance of the EsentException class with a specified error message.
/// </summary>
/// <param name="message">The message that describes the error.</param>
protected EsentException(string message)
: base(message)
{
}
/// <summary>
/// Initializes a new instance of the EsentException class. This constructor
/// is used to deserialize a serialized exception.
/// </summary>
/// <param name="info">The data needed to deserialize the object.</param>
/// <param name="context">The deserialization context.</param>
protected EsentException(SerializationInfo info, StreamingContext context)
#if MANAGEDESENT_SUPPORTS_SERIALIZATION || !MANAGEDESENT_ON_WSA
: base(info, context)
#endif
{
}
}
}

View File

@ -0,0 +1,108 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{E929E163-52A0-4AAC-917B-6D7FAF70C45E}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Esent.Interop</RootNamespace>
<AssemblyName>Esent.Interop</AssemblyName>
<TargetFrameworks>netstandard2.0</TargetFrameworks>
<EnableDefaultCompileItems>false</EnableDefaultCompileItems>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
<DefineConstants></DefineConstants>
<FileAlignment>512</FileAlignment>
<SignAssembly>true</SignAssembly>
<PublicKeyFile>..\scripts\internal\35MSSharedLib1024.snk</PublicKeyFile>
<Platforms>AnyCPU;x86</Platforms>
</PropertyGroup>
<!-- The .snk file won't be published to codeplex. -->
<PropertyGroup Condition="Exists('$(PublicKeyFile)')">
<DefineConstants>$(DefineConstants);STRONG_NAMED</DefineConstants>
<DelaySign>true</DelaySign>
<AssemblyOriginatorKeyFile>$(PublicKeyFile)</AssemblyOriginatorKeyFile>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>$(DefineConstants);DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<CheckForOverflowUnderflow>true</CheckForOverflowUnderflow>
<DocumentationFile>$(OutputPath)\$(AssemblyName).xml</DocumentationFile>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x86'">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>$(DefineConstants);DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<CheckForOverflowUnderflow>true</CheckForOverflowUnderflow>
<DocumentationFile>$(OutputPath)\$(AssemblyName).xml</DocumentationFile>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>$(DefineConstants)</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<DocumentationFile>$(OutputPath)\$(AssemblyName).xml</DocumentationFile>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<CheckForOverflowUnderflow>true</CheckForOverflowUnderflow>
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x86'">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>$(DefineConstants)</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<DocumentationFile>$(OutputPath)\$(AssemblyName).xml</DocumentationFile>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<CheckForOverflowUnderflow>true</CheckForOverflowUnderflow>
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<ItemGroup>
<Compile Include="*.cs" />
<Compile Remove="Properties\**" />
<EmbeddedResource Remove="Properties\**" />
<None Remove="Properties\**" />
<Compile Include="Esent\CallbackDataConverter.cs" />
<Compile Include="Esent\EsentJetApi.cs" />
<Compile Include="Esent\EsentNativeMethods.cs" />
<Compile Include="Esent\AssemblyInfo.cs" />
</ItemGroup>
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>

View File

@ -0,0 +1,50 @@
//-----------------------------------------------------------------------
// <copyright file="EsentInvalidColumnException.cs" company="Microsoft Corporation">
// Copyright (c) Microsoft Corporation.
// </copyright>
//-----------------------------------------------------------------------
namespace Microsoft.Isam.Esent.Interop
{
using System;
using System.Runtime.Serialization;
/// <summary>
/// Exception thrown when a column conversion fails.
/// </summary>
[Serializable]
public class EsentInvalidColumnException : EsentException
{
/// <summary>
/// Initializes a new instance of the EsentInvalidColumnException class.
/// </summary>
public EsentInvalidColumnException()
{
}
#if MANAGEDESENT_ON_CORECLR
#else
/// <summary>
/// Initializes a new instance of the EsentInvalidColumnException class. This constructor
/// is used to deserialize a serialized exception.
/// </summary>
/// <param name="info">The data needed to deserialize the object.</param>
/// <param name="context">The deserialization context.</param>
protected EsentInvalidColumnException(SerializationInfo info, StreamingContext context) :
base(info, context)
{
}
#endif
/// <summary>
/// Gets a text message describing the exception.
/// </summary>
public override string Message
{
get
{
return "Column is not valid for this operation";
}
}
}
}

View File

@ -0,0 +1,127 @@
//-----------------------------------------------------------------------
// <copyright file="EsentResource.cs" company="Microsoft Corporation">
// Copyright (c) Microsoft Corporation.
// </copyright>
//-----------------------------------------------------------------------
namespace Microsoft.Isam.Esent.Interop
{
using System;
using System.Diagnostics;
/// <summary>
/// This is the base class for all esent resource objects.
/// Subclasses of this class can allocate and release unmanaged
/// resources.
/// </summary>
public abstract class EsentResource : IDisposable
{
/// <summary>
/// True if a resource has been allocated.
/// </summary>
private bool hasResource;
/// <summary>
/// True if this object has been disposed.
/// </summary>
private bool isDisposed;
/// <summary>
/// Finalizes an instance of the EsentResource class.
/// </summary>
~EsentResource()
{
this.Dispose(false);
}
/// <summary>
/// Gets a value indicating whether the underlying resource
/// is currently allocated.
/// </summary>
protected bool HasResource
{
get
{
return this.hasResource;
}
}
/// <summary>
/// Dispose of this object, releasing the underlying
/// Esent resource.
/// </summary>
public void Dispose()
{
this.Dispose(true);
GC.SuppressFinalize(this);
}
/// <summary>
/// Called by Dispose and the finalizer.
/// </summary>
/// <param name="isDisposing">
/// True if called from Dispose.
/// </param>
protected virtual void Dispose(bool isDisposing)
{
if (isDisposing)
{
if (this.hasResource)
{
this.ReleaseResource();
Debug.Assert(!this.hasResource, "Resource was not freed");
}
this.isDisposed = true;
}
else
{
if (this.hasResource)
{
// We should not get to this point. The problem is that if
// we use finalizers to free esent resources they may end
// up being freed in the wrong order (e.g. JetEndSession is
// called before JetCloseTable). Freeing esent resources
// in the wrong order will generate EsentExceptions.
Trace.TraceWarning("Non-finalized ESENT resource {0}", this);
}
}
}
/// <summary>
/// Throw an exception if this object has been disposed.
/// </summary>
protected void CheckObjectIsNotDisposed()
{
if (this.isDisposed)
{
throw new ObjectDisposedException("EsentResource");
}
}
/// <summary>
/// Called by a subclass when a resource is allocated.
/// </summary>
protected void ResourceWasAllocated()
{
this.CheckObjectIsNotDisposed();
Debug.Assert(!this.hasResource, "Resource is already allocated");
this.hasResource = true;
}
/// <summary>
/// Called by a subclass when a resource is freed.
/// </summary>
protected void ResourceWasReleased()
{
Debug.Assert(this.hasResource, "Resource is not allocated");
this.CheckObjectIsNotDisposed();
this.hasResource = false;
}
/// <summary>
/// Implemented by the subclass to release a resource.
/// </summary>
protected abstract void ReleaseResource();
}
}

View File

@ -0,0 +1,113 @@
//-----------------------------------------------------------------------
// <copyright file="EsentStopwatch.cs" company="Microsoft Corporation">
// Copyright (c) Microsoft Corporation.
// </copyright>
//-----------------------------------------------------------------------
namespace Microsoft.Isam.Esent.Interop
{
using System;
using System.Diagnostics;
using Microsoft.Isam.Esent.Interop.Vista;
/// <summary>
/// Provides a set of methods and properties that you can use to measure
/// ESENT work statistics for a thread. If the current version of ESENT
/// doesn't support <see cref="VistaApi.JetGetThreadStats"/> then all
/// ESENT statistics will be 0.
/// </summary>
public class EsentStopwatch
{
/// <summary>
/// Used to measure how long statistics are collected for.
/// </summary>
private Stopwatch stopwatch;
/// <summary>
/// The stats at the start of our collection.
/// </summary>
private JET_THREADSTATS statsAtStart;
/// <summary>
/// Gets a value indicating whether the EsentStopwatch timer is running.
/// </summary>
public bool IsRunning { get; private set; }
/// <summary>
/// Gets the total ESENT work stats measured by the current instance.
/// </summary>
public JET_THREADSTATS ThreadStats { get; private set; }
/// <summary>
/// Gets the total elapsed time measured by the current instance.
/// </summary>
public TimeSpan Elapsed { get; private set; }
/// <summary>
/// Initializes a new EsentStopwatch instance and starts
/// measuring elapsed time.
/// </summary>
/// <returns>A new, running EsentStopwatch.</returns>
public static EsentStopwatch StartNew()
{
var stopwatch = new EsentStopwatch();
stopwatch.Start();
return stopwatch;
}
/// <summary>
/// Returns a <see cref="T:System.String"/> that represents the current <see cref="Stopwatch"/>.
/// </summary>
/// <returns>
/// A <see cref="T:System.String"/> that represents the current <see cref="Stopwatch"/>.
/// </returns>
public override string ToString()
{
return this.IsRunning ? "EsentStopwatch (running)" : this.Elapsed.ToString();
}
/// <summary>
/// Starts measuring ESENT work.
/// </summary>
public void Start()
{
this.Reset();
this.stopwatch = Stopwatch.StartNew();
this.IsRunning = true;
if (EsentVersion.SupportsVistaFeatures)
{
VistaApi.JetGetThreadStats(out this.statsAtStart);
}
}
/// <summary>
/// Stops measuring ESENT work.
/// </summary>
public void Stop()
{
if (this.IsRunning)
{
this.IsRunning = false;
this.stopwatch.Stop();
this.Elapsed = this.stopwatch.Elapsed;
if (EsentVersion.SupportsVistaFeatures)
{
JET_THREADSTATS statsAtEnd;
VistaApi.JetGetThreadStats(out statsAtEnd);
this.ThreadStats = statsAtEnd - this.statsAtStart;
}
}
}
/// <summary>
/// Stops time interval measurement and resets the thread statistics.
/// </summary>
public void Reset()
{
this.stopwatch = null;
this.ThreadStats = new JET_THREADSTATS();
this.Elapsed = TimeSpan.Zero;
this.IsRunning = false;
}
}
}

View File

@ -0,0 +1,134 @@
//-----------------------------------------------------------------------
// <copyright file="EsentVersion.cs" company="Microsoft Corporation">
// Copyright (c) Microsoft Corporation.
// </copyright>
//-----------------------------------------------------------------------
namespace Microsoft.Isam.Esent.Interop
{
using Microsoft.Isam.Esent.Interop.Implementation;
/// <summary>
/// Gives information about the version of esent being used.
/// </summary>
public static class EsentVersion
{
/// <summary>
/// Gets a value indicating whether the current version of esent
/// supports features available in the Windows Server 2003 version of
/// esent.
/// </summary>
public static bool SupportsServer2003Features
{
get
{
return Capabilities.SupportsServer2003Features;
}
}
/// <summary>
/// Gets a value indicating whether the current version of esent
/// supports features available in the Windows Vista version of
/// esent.
/// </summary>
public static bool SupportsVistaFeatures
{
get
{
return Capabilities.SupportsVistaFeatures;
}
}
/// <summary>
/// Gets a value indicating whether the current version of esent
/// supports features available in the Windows 7 version of
/// esent.
/// </summary>
public static bool SupportsWindows7Features
{
get
{
return Capabilities.SupportsWindows7Features;
}
}
/// <summary>
/// Gets a value indicating whether the current version of esent
/// supports features available in the Windows 8 version of
/// esent.
/// </summary>
public static bool SupportsWindows8Features
{
get
{
return Capabilities.SupportsWindows8Features;
}
}
/// <summary>
/// Gets a value indicating whether the current version of esent
/// supports features available in the Windows 8.1 version of
/// esent.
/// </summary>
public static bool SupportsWindows81Features
{
get
{
return Capabilities.SupportsWindows81Features;
}
}
/// <summary>
/// Gets a value indicating whether the current version of esent
/// supports features available in the Windows 10 version of
/// esent.
/// </summary>
public static bool SupportsWindows10Features
{
get
{
return Capabilities.SupportsWindows10Features;
}
}
/// <summary>
/// Gets a value indicating whether the current version of esent
/// can use non-ASCII paths to access databases.
/// </summary>
public static bool SupportsUnicodePaths
{
get
{
return Capabilities.SupportsUnicodePaths;
}
}
/// <summary>
/// Gets a value indicating whether large (> 255 byte) keys are supported.
/// The key size for an index can be specified in the <see cref="JET_INDEXCREATE"/>
/// object.
/// </summary>
public static bool SupportsLargeKeys
{
get
{
return Capabilities.SupportsLargeKeys;
}
}
/// <summary>
/// Gets a description of the current Esent capabilities.
/// </summary>
/// <remarks>
/// We allow this to be set separately so that capabilities can
/// be downgraded for testing.
/// </remarks>
private static JetCapabilities Capabilities
{
get
{
return Api.Impl.Capabilities;
}
}
}
}

View File

@ -0,0 +1,69 @@
//-----------------------------------------------------------------------
// <copyright file="FloatColumnValue.cs" company="Microsoft Corporation">
// Copyright (c) Microsoft Corporation.
// </copyright>
//-----------------------------------------------------------------------
namespace Microsoft.Isam.Esent.Interop
{
using System;
using System.Diagnostics;
/// <summary>
/// A <see cref="float"/> column value.
/// </summary>
public class FloatColumnValue : ColumnValueOfStruct<float>
{
/// <summary>
/// Gets the size of the value in the column. This returns 0 for
/// variable sized columns (i.e. binary and string).
/// </summary>
protected override int Size
{
[DebuggerStepThrough]
get { return sizeof(float); }
}
/// <summary>
/// Recursive SetColumns method for data pinning. This populates the buffer and
/// calls the inherited SetColumns method.
/// </summary>
/// <param name="sesid">The session to use.</param>
/// <param name="tableid">
/// The table to set the columns in. An update should be prepared.
/// </param>
/// <param name="columnValues">
/// Column values to set.
/// </param>
/// <param name="nativeColumns">
/// Structures to put the pinned data in.
/// </param>
/// <param name="i">Offset of this object in the array.</param>
/// <returns>An error code.</returns>
internal override unsafe int SetColumns(JET_SESID sesid, JET_TABLEID tableid, ColumnValue[] columnValues, NATIVE_SETCOLUMN* nativeColumns, int i)
{
var data = this.Value.GetValueOrDefault();
return this.SetColumns(sesid, tableid, columnValues, nativeColumns, i, &data, sizeof(float), this.Value.HasValue);
}
/// <summary>
/// Given data retrieved from ESENT, decode the data and set the value in the ColumnValue object.
/// </summary>
/// <param name="value">An array of bytes.</param>
/// <param name="startIndex">The starting position within the bytes.</param>
/// <param name="count">The number of bytes to decode.</param>
/// <param name="err">The error returned from ESENT.</param>
protected override void GetValueFromBytes(byte[] value, int startIndex, int count, int err)
{
if (JET_wrn.ColumnNull == (JET_wrn)err)
{
this.Value = null;
}
else
{
this.CheckDataCount(count);
this.Value = BitConverter.ToSingle(value, startIndex);
}
}
}
}

View File

@ -0,0 +1,94 @@
//-----------------------------------------------------------------------
// <copyright file="GCHandleCollection.cs" company="Microsoft Corporation">
// Copyright (c) Microsoft Corporation.
// </copyright>
//-----------------------------------------------------------------------
namespace Microsoft.Isam.Esent.Interop.Implementation
{
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Runtime.InteropServices;
/// <summary>
/// A collection of GCHandles for pinned objects. The handles
/// are freed when this object is disposed.
/// </summary>
[StructLayout(LayoutKind.Auto)]
internal struct GCHandleCollection : IDisposable
{
/// <summary>
/// The handles of the objects being pinned.
/// </summary>
private GCHandle[] handles;
/// <summary>
/// Handle count.
/// </summary>
private int count;
/// <summary>
/// Disposes of the object.
/// </summary>
public void Dispose()
{
if (null != this.handles)
{
for (int i = 0; i < this.count; i++)
{
this.handles[i].Free();
}
this.handles = null;
}
}
/// <summary>
/// Add an object to the handle collection. This automatically
/// pins the object.
/// </summary>
/// <param name="value">The object to pin.</param>
/// <returns>
/// The address of the pinned object. This is valid until the
/// GCHandleCollection is disposed.
/// </returns>
public IntPtr Add(object value)
{
if (null == value)
{
return IntPtr.Zero;
}
if (null == this.handles)
{
this.handles = new GCHandle[4]; // same as List<T>
}
else if (this.count == this.handles.Length)
{
Array.Resize(ref this.handles, this.count * 2);
}
Debug.Assert(this.count < this.handles.Length, "Index out of bound");
GCHandle handle = GCHandle.Alloc(value, GCHandleType.Pinned);
this.handles[this.count++] = handle;
IntPtr pinned = handle.AddrOfPinnedObject();
Debug.Assert(IntPtr.Zero != pinned, "Pinned object has null address");
return pinned;
}
/// <summary>
/// Set handle array capacity.
/// </summary>
/// <param name="capacity">Estimated handle count</param>
public void SetCapacity(int capacity)
{
if (null == this.handles)
{
this.handles = new GCHandle[capacity];
}
}
}
}

View File

@ -0,0 +1,64 @@
//-----------------------------------------------------------------------
// <copyright file="GenericEnumerable.cs" company="Microsoft Corporation">
// Copyright (c) Microsoft Corporation.
// </copyright>
//-----------------------------------------------------------------------
namespace Microsoft.Isam.Esent.Interop
{
using System.Collections;
using System.Collections.Generic;
/// <summary>
/// IEnumerable class that takes a delegate to create the enumerator it returns.
/// </summary>
/// <typeparam name="T">The type returned by the enumerator.</typeparam>
internal class GenericEnumerable<T> : IEnumerable<T>
{
/// <summary>
/// The delegate used to create the enumerator.
/// </summary>
private readonly CreateEnumerator enumeratorCreator;
/// <summary>
/// Initializes a new instance of the <see cref="GenericEnumerable{T}"/> class.
/// </summary>
/// <param name="enumeratorCreator">
/// The enumerator creator.
/// </param>
public GenericEnumerable(CreateEnumerator enumeratorCreator)
{
this.enumeratorCreator = enumeratorCreator;
}
/// <summary>
/// IEnumerator creating delegate.
/// </summary>
/// <returns>A new enumerator.</returns>
public delegate IEnumerator<T> CreateEnumerator();
/// <summary>
/// Returns an enumerator that iterates through the collection.
/// </summary>
/// <returns>
/// A <see cref="T:System.Collections.Generic.IEnumerator`1"/>
/// that can be used to iterate through the collection.
/// </returns>
public IEnumerator<T> GetEnumerator()
{
return this.enumeratorCreator();
}
/// <summary>
/// Returns an enumerator that iterates through a collection.
/// </summary>
/// <returns>
/// A <see cref="T:System.Collections.IEnumerator"/>
/// object that can be used to iterate through the collection.
/// </returns>
IEnumerator IEnumerable.GetEnumerator()
{
return this.GetEnumerator();
}
}
}

View File

@ -0,0 +1,48 @@
// --------------------------------------------------------------------------------------------------------------------
// <copyright file="GetLockHelpers.cs" company="Microsoft Corporation">
// Copyright (c) Microsoft Corporation.
// </copyright>
// <summary>
// Helper methods for JetMakeKey.
// </summary>
// --------------------------------------------------------------------------------------------------------------------
#if !MANAGEDESENT_ON_WSA // Not exposed in MSDK
namespace Microsoft.Isam.Esent.Interop
{
using System.Diagnostics;
/// <summary>
/// Helper methods for the ESENT API. These wrap JetMakeKey.
/// </summary>
public static partial class Api
{
/// <summary>
/// Explicitly reserve the ability to update a row, write lock, or to explicitly prevent a row from
/// being updated by any other session, read lock. Normally, row write locks are acquired implicitly as a
/// result of updating rows. Read locks are usually not required because of record versioning. However,
/// in some cases a transaction may desire to explicitly lock a row to enforce serialization, or to ensure
/// that a subsequent operation will succeed.
/// </summary>
/// <param name="sesid">The session to use.</param>
/// <param name="tableid">The cursor to use. A lock will be acquired on the current record.</param>
/// <param name="grbit">Lock options, use this to specify which type of lock to obtain.</param>
/// <returns>
/// True if the lock was obtained, false otherwise. An exception is thrown if an unexpected
/// error is encountered.
/// </returns>
public static bool TryGetLock(JET_SESID sesid, JET_TABLEID tableid, GetLockGrbit grbit)
{
var err = (JET_err)Impl.JetGetLock(sesid, tableid, grbit);
if (JET_err.WriteConflict == err)
{
return false;
}
Api.Check((int)err);
Debug.Assert(err >= JET_err.Success, "Exception should have been thrown in case of error");
return true;
}
}
}
#endif // !MANAGEDESENT_ON_WSA

View File

@ -0,0 +1,82 @@
//-----------------------------------------------------------------------
// <copyright file="GuidColumnValue.cs" company="Microsoft Corporation">
// Copyright (c) Microsoft Corporation.
// </copyright>
//-----------------------------------------------------------------------
namespace Microsoft.Isam.Esent.Interop
{
using System;
using System.Diagnostics;
/// <summary>
/// A <see cref="Guid"/> column value.
/// </summary>
public class GuidColumnValue : ColumnValueOfStruct<Guid>
{
/// <summary>
/// Gets the size of the value in the column. This returns 0 for
/// variable sized columns (i.e. binary and string).
/// </summary>
protected override int Size
{
[DebuggerStepThrough]
get { return 16; /* sizeof(Guid) */ }
}
/// <summary>
/// Recursive SetColumns method for data pinning. This populates the buffer and
/// calls the inherited SetColumns method.
/// </summary>
/// <param name="sesid">The session to use.</param>
/// <param name="tableid">
/// The table to set the columns in. An update should be prepared.
/// </param>
/// <param name="columnValues">
/// Column values to set.
/// </param>
/// <param name="nativeColumns">
/// Structures to put the pinned data in.
/// </param>
/// <param name="i">Offset of this object in the array.</param>
/// <returns>An error code.</returns>
internal override unsafe int SetColumns(JET_SESID sesid, JET_TABLEID tableid, ColumnValue[] columnValues, NATIVE_SETCOLUMN* nativeColumns, int i)
{
Guid data = this.Value.GetValueOrDefault();
return this.SetColumns(sesid, tableid, columnValues, nativeColumns, i, &data, this.Size, this.Value.HasValue);
}
/// <summary>
/// Given data retrieved from ESENT, decode the data and set the value in the ColumnValue object.
/// </summary>
/// <param name="value">An array of bytes.</param>
/// <param name="startIndex">The starting position within the bytes.</param>
/// <param name="count">The number of bytes to decode.</param>
/// <param name="err">The error returned from ESENT.</param>
protected override void GetValueFromBytes(byte[] value, int startIndex, int count, int err)
{
if (JET_wrn.ColumnNull == (JET_wrn)err)
{
this.Value = null;
}
else
{
this.CheckDataCount(count);
unsafe
{
// There isn't a convenient Guid constructor for this case, so
// we copy the data manually.
Guid guid;
void* guidBuffer = &guid;
byte* buffer = (byte*)guidBuffer;
for (int i = 0; i < this.Size; ++i)
{
buffer[i] = value[startIndex + i];
}
this.Value = guid;
}
}
}
}
}

View File

@ -0,0 +1,26 @@
//-----------------------------------------------------------------------
// <copyright file="IContentEquatable.cs" company="Microsoft Corporation">
// Copyright (c) Microsoft Corporation.
// </copyright>
//-----------------------------------------------------------------------
namespace Microsoft.Isam.Esent.Interop
{
/// <summary>
/// Interface for objects that can have their contents compared against
/// each other. This should be used for equality comparisons on mutable
/// reference objects where overriding Equals() and GetHashCode() isn't a
/// good idea.
/// </summary>
/// <typeparam name="T">The type of objects to compare.</typeparam>
public interface IContentEquatable<T>
{
/// <summary>
/// Returns a value indicating whether this instance is equal
/// to another instance.
/// </summary>
/// <param name="other">An instance to compare with this instance.</param>
/// <returns>True if the two instances are equal.</returns>
bool ContentEquals(T other);
}
}

View File

@ -0,0 +1,22 @@
//-----------------------------------------------------------------------
// <copyright file="IDeepCloneable.cs" company="Microsoft Corporation">
// Copyright (c) Microsoft Corporation.
// </copyright>
//-----------------------------------------------------------------------
namespace Microsoft.Isam.Esent.Interop
{
/// <summary>
/// Interface for objects that can be cloned. This creates a deep copy of
/// the object. It is used for cloning meta-data objects.
/// </summary>
/// <typeparam name="T">The type of object.</typeparam>
public interface IDeepCloneable<T>
{
/// <summary>
/// Returns a deep copy of the object.
/// </summary>
/// <returns>A deep copy of the object.</returns>
T DeepClone();
}
}

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,19 @@
//-----------------------------------------------------------------------
// <copyright file="INullableJetStruct.cs" company="Microsoft Corporation">
// Copyright (c) Microsoft Corporation.
// </copyright>
//-----------------------------------------------------------------------
namespace Microsoft.Isam.Esent.Interop
{
/// <summary>
/// Interface for Jet structures that are nullable (can have null values).
/// </summary>
public interface INullableJetStruct
{
/// <summary>
/// Gets a value indicating whether the structure has a null value.
/// </summary>
bool HasValue { get; }
}
}

View File

@ -0,0 +1,189 @@
//-----------------------------------------------------------------------
// <copyright file="IndexInfo.cs" company="Microsoft Corporation">
// Copyright (c) Microsoft Corporation.
// </copyright>
//-----------------------------------------------------------------------
namespace Microsoft.Isam.Esent.Interop
{
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Diagnostics;
using System.Globalization;
using System.Text;
/// <summary>
/// Information about one esent index. This is not an interop
/// class, but is used by the meta-data helper methods.
/// </summary>
[Serializable]
public class IndexInfo
{
/// <summary>
/// The name of the index.
/// </summary>
private readonly string name;
/// <summary>
/// The culture info of the index.
/// </summary>
private readonly CultureInfo cultureInfo;
/// <summary>
/// Index comparison options.
/// </summary>
private readonly CompareOptions compareOptions;
/// <summary>
/// Index segments.
/// </summary>
private readonly ReadOnlyCollection<IndexSegment> indexSegments;
/// <summary>
/// Index options.
/// </summary>
private readonly CreateIndexGrbit grbit;
/// <summary>
/// Number of unique keys in the index.
/// </summary>
private readonly int keys;
/// <summary>
/// Number of entries in the index.
/// </summary>
private readonly int entries;
/// <summary>
/// Number of pages in the index.
/// </summary>
private readonly int pages;
/// <summary>
/// Initializes a new instance of the IndexInfo class.
/// </summary>
/// <param name="name">Name of the index.</param>
/// <param name="cultureInfo">CultureInfo for string sorting.</param>
/// <param name="compareOptions">String comparison options.</param>
/// <param name="indexSegments">Array of index segment descriptions.</param>
/// <param name="grbit">Index options.</param>
/// <param name="keys">Number of unique keys in the index.</param>
/// <param name="entries">Number of entries in the index.</param>
/// <param name="pages">Number of pages in the index.</param>
internal IndexInfo(
string name,
CultureInfo cultureInfo,
CompareOptions compareOptions,
IndexSegment[] indexSegments,
CreateIndexGrbit grbit,
int keys,
int entries,
int pages)
{
this.name = name;
this.cultureInfo = cultureInfo;
this.compareOptions = compareOptions;
this.indexSegments = new ReadOnlyCollection<IndexSegment>(indexSegments);
this.grbit = grbit;
this.keys = keys;
this.entries = entries;
this.pages = pages;
}
/// <summary>
/// Gets the name of the index.
/// </summary>
public string Name
{
[DebuggerStepThrough]
get { return this.name; }
}
/// <summary>
/// Gets the CultureInfo the index is sorted by.
/// </summary>
public CultureInfo CultureInfo
{
[DebuggerStepThrough]
get { return this.cultureInfo; }
}
/// <summary>
/// Gets the CompareOptions for the index.
/// </summary>
public CompareOptions CompareOptions
{
[DebuggerStepThrough]
get { return this.compareOptions; }
}
/// <summary>
/// Gets the segments of the index.
/// </summary>
public IList<IndexSegment> IndexSegments
{
[DebuggerStepThrough]
get { return this.indexSegments; }
}
/// <summary>
/// Gets the index options.
/// </summary>
public CreateIndexGrbit Grbit
{
[DebuggerStepThrough]
get { return this.grbit; }
}
/// <summary>
/// Gets the number of unique keys in the index.
/// This value is not current and is only is updated by Api.JetComputeStats.
/// </summary>
public int Keys
{
[DebuggerStepThrough]
get { return this.keys; }
}
/// <summary>
/// Gets the number of entries in the index.
/// This value is not current and is only is updated by Api.JetComputeStats.
/// </summary>
public int Entries
{
[DebuggerStepThrough]
get { return this.entries; }
}
/// <summary>
/// Gets the number of pages in the index.
/// This value is not current and is only is updated by Api.JetComputeStats.
/// </summary>
public int Pages
{
[DebuggerStepThrough]
get { return this.pages; }
}
/// <summary>
/// Returns a <see cref="T:System.String"/> that represents the current <see cref="IndexInfo"/>.
/// </summary>
/// <returns>
/// A <see cref="T:System.String"/> that represents the current <see cref="IndexInfo"/>.
/// </returns>
public override string ToString()
{
StringBuilder sb = new StringBuilder();
sb.Append(this.Name);
sb.Append(" (");
foreach (var segment in this.IndexSegments)
{
sb.Append(segment.ToString());
}
sb.Append(")");
return sb.ToString();
}
}
}

View File

@ -0,0 +1,153 @@
//-----------------------------------------------------------------------
// <copyright file="IndexInfoEnumerator.cs" company="Microsoft Corporation">
// Copyright (c) Microsoft Corporation.
// </copyright>
//-----------------------------------------------------------------------
namespace Microsoft.Isam.Esent.Interop
{
using System.Diagnostics;
using System.Globalization;
using System.Text;
using Microsoft.Isam.Esent.Interop.Windows8;
/// <summary>
/// Base class for enumerators that return IndexInfo objects. Subclasses differ
/// by how they open the table.
/// </summary>
internal abstract class IndexInfoEnumerator : TableEnumerator<IndexInfo>
{
/// <summary>
/// Initializes a new instance of the <see cref="IndexInfoEnumerator"/> class.
/// </summary>
/// <param name="sesid">
/// The session to use.
/// </param>
protected IndexInfoEnumerator(JET_SESID sesid) : base(sesid)
{
}
/// <summary>
/// Gets or sets the indexlist used to retrieve data.
/// </summary>
protected JET_INDEXLIST Indexlist { get; set; }
/// <summary>
/// Gets the entry the cursor is currently positioned on.
/// </summary>
/// <returns>The entry the cursor is currently positioned on.</returns>
protected override IndexInfo GetCurrent()
{
return this.GetIndexInfoFromIndexlist(this.Sesid, this.Indexlist);
}
/// <summary>
/// Retrieves information about indexes on a table.
/// </summary>
/// <param name="sesid">The session to use.</param>
/// <param name="indexname">The name of the index.</param>
/// <param name="result">Filled in with information about indexes on the table.</param>
/// <param name="infoLevel">The type of information to retrieve.</param>
protected abstract void GetIndexInfo(
JET_SESID sesid,
string indexname,
out string result,
JET_IdxInfo infoLevel);
/// <summary>
/// Create an array of IndexSegment objects from the data in the current JET_INDEXLIST entry.
/// </summary>
/// <param name="sesid">The session to use.</param>
/// <param name="indexlist">The indexlist to take the data from.</param>
/// <returns>An array of IndexSegment objects containing the information for the current index.</returns>
private static IndexSegment[] GetIndexSegmentsFromIndexlist(JET_SESID sesid, JET_INDEXLIST indexlist)
{
var numSegments = (int)Api.RetrieveColumnAsInt32(sesid, indexlist.tableid, indexlist.columnidcColumn);
Debug.Assert(numSegments > 0, "Index has zero index segments");
// If we use the wide API (Vista+), then the temp table will be in UTF-16.
Encoding encodingOfTextColumns = EsentVersion.SupportsVistaFeatures ? Encoding.Unicode : LibraryHelpers.EncodingASCII;
var segments = new IndexSegment[numSegments];
for (int i = 0; i < numSegments; ++i)
{
string columnName = Api.RetrieveColumnAsString(
sesid,
indexlist.tableid,
indexlist.columnidcolumnname,
encodingOfTextColumns,
RetrieveColumnGrbit.None);
columnName = StringCache.TryToIntern(columnName);
var coltyp = (JET_coltyp)Api.RetrieveColumnAsInt32(sesid, indexlist.tableid, indexlist.columnidcoltyp);
var grbit =
(IndexKeyGrbit)Api.RetrieveColumnAsInt32(sesid, indexlist.tableid, indexlist.columnidgrbitColumn);
bool isAscending = IndexKeyGrbit.Ascending == grbit;
var cp = (JET_CP)Api.RetrieveColumnAsInt16(sesid, indexlist.tableid, indexlist.columnidCp);
bool isASCII = JET_CP.ASCII == cp;
segments[i] = new IndexSegment(columnName, coltyp, isAscending, isASCII);
if (i < numSegments - 1)
{
Api.JetMove(sesid, indexlist.tableid, JET_Move.Next, MoveGrbit.None);
}
}
return segments;
}
/// <summary>
/// Create an IndexInfo object from the data in the current JET_INDEXLIST entry.
/// </summary>
/// <param name="sesid">The session to use.</param>
/// <param name="indexlist">The indexlist to take the data from.</param>
/// <returns>An IndexInfo object containing the information from that record.</returns>
private IndexInfo GetIndexInfoFromIndexlist(JET_SESID sesid, JET_INDEXLIST indexlist)
{
// If we use the wide API (Vista+), then the temp table will be in UTF-16.
Encoding encodingOfTextColumns = EsentVersion.SupportsVistaFeatures ? Encoding.Unicode : LibraryHelpers.EncodingASCII;
string name = Api.RetrieveColumnAsString(
sesid, indexlist.tableid, indexlist.columnidindexname, encodingOfTextColumns, RetrieveColumnGrbit.None);
name = StringCache.TryToIntern(name);
CultureInfo cultureInfo = null;
if (EsentVersion.SupportsWindows8Features)
{
string localeName;
this.GetIndexInfo(sesid, name, out localeName, Windows8IdxInfo.LocaleName);
cultureInfo = new CultureInfo(localeName);
}
else
{
#if !MANAGEDESENT_ON_CORECLR
// This probably won't work on platforms that don't support LCIDs. Newer environments have dropped
// LCIDs in favour of locale names. But currently JET_INDEXLIST doesn't expose columnidLocale.
int lcid = (int)Api.RetrieveColumnAsInt16(sesid, indexlist.tableid, indexlist.columnidLangid);
cultureInfo = LibraryHelpers.CreateCultureInfoByLcid(lcid);
#endif // !MANAGEDESENT_ON_CORECLR
}
uint lcmapFlags = (uint)Api.RetrieveColumnAsUInt32(sesid, indexlist.tableid, indexlist.columnidLCMapFlags);
CompareOptions compareOptions = Conversions.CompareOptionsFromLCMapFlags(lcmapFlags);
uint grbit = (uint)Api.RetrieveColumnAsUInt32(sesid, indexlist.tableid, indexlist.columnidgrbitIndex);
int keys = (int)Api.RetrieveColumnAsInt32(sesid, indexlist.tableid, indexlist.columnidcKey);
int entries = (int)Api.RetrieveColumnAsInt32(sesid, indexlist.tableid, indexlist.columnidcEntry);
int pages = (int)Api.RetrieveColumnAsInt32(sesid, indexlist.tableid, indexlist.columnidcPage);
IndexSegment[] segments = GetIndexSegmentsFromIndexlist(sesid, indexlist);
return new IndexInfo(
name,
cultureInfo,
compareOptions,
segments,
(CreateIndexGrbit)grbit,
keys,
entries,
pages);
}
}
}

View File

@ -0,0 +1,152 @@
//-----------------------------------------------------------------------
// <copyright file="IndexSegment.cs" company="Microsoft Corporation">
// Copyright (c) Microsoft Corporation.
// </copyright>
//-----------------------------------------------------------------------
namespace Microsoft.Isam.Esent.Interop
{
using System;
using System.Diagnostics;
using System.Globalization;
/// <summary>
/// Describes one segment of an index.
/// </summary>
[Serializable]
public class IndexSegment : IEquatable<IndexSegment>
{
/// <summary>
/// The name of the column.
/// </summary>
private readonly string columnName;
/// <summary>
/// The type of the column.
/// </summary>
private readonly JET_coltyp coltyp;
/// <summary>
/// True if the column is sorted in ascending order.
/// </summary>
private readonly bool isAscending;
/// <summary>
/// True if the column is an ASCII column.
/// </summary>
private readonly bool isASCII;
/// <summary>
/// Initializes a new instance of the IndexSegment class.
/// </summary>
/// <param name="name">The name of the indexed column.</param>
/// <param name="coltyp">The type of the column.</param>
/// <param name="isAscending">True if the column is ascending.</param>
/// <param name="isASCII">True if the column is over an ASCII column.</param>
internal IndexSegment(
string name,
JET_coltyp coltyp,
bool isAscending,
bool isASCII)
{
this.columnName = name;
this.coltyp = coltyp;
this.isAscending = isAscending;
this.isASCII = isASCII;
}
/// <summary>
/// Gets name of the column being indexed.
/// </summary>
public string ColumnName
{
[DebuggerStepThrough]
get { return this.columnName; }
}
/// <summary>
/// Gets the type of the column being indexed.
/// </summary>
public JET_coltyp Coltyp
{
[DebuggerStepThrough]
get { return this.coltyp; }
}
/// <summary>
/// Gets a value indicating whether the index segment is ascending.
/// </summary>
public bool IsAscending
{
[DebuggerStepThrough]
get { return this.isAscending; }
}
/// <summary>
/// Gets a value indicating whether the index segment is over an ASCII text
/// column. This value is only meaningful for text column segments.
/// </summary>
public bool IsASCII
{
[DebuggerStepThrough]
get { return this.isASCII; }
}
/// <summary>
/// Returns a value indicating whether this instance is equal
/// to another instance.
/// </summary>
/// <param name="obj">An object to compare with this instance.</param>
/// <returns>True if the two instances are equal.</returns>
public override bool Equals(object obj)
{
if (obj == null || this.GetType() != obj.GetType())
{
return false;
}
return this.Equals((IndexSegment)obj);
}
/// <summary>
/// Generate a string representation of the instance.
/// </summary>
/// <returns>The structure as a string.</returns>
public override string ToString()
{
return string.Format(
CultureInfo.InvariantCulture, "{0}{1}({2})", this.isAscending ? "+" : "-", this.columnName, this.coltyp);
}
/// <summary>
/// Returns the hash code for this instance.
/// </summary>
/// <returns>The hash code for this instance.</returns>
public override int GetHashCode()
{
return this.columnName.GetHashCode()
^ (int)this.coltyp * 31
^ (this.isAscending ? 0x10000 : 0x20000)
^ (this.isASCII ? 0x40000 : 0x80000);
}
/// <summary>
/// Returns a value indicating whether this instance is equal
/// to another instance.
/// </summary>
/// <param name="other">An instance to compare with this instance.</param>
/// <returns>True if the two instances are equal.</returns>
public bool Equals(IndexSegment other)
{
if (null == other)
{
return false;
}
return this.columnName.Equals(other.columnName, StringComparison.OrdinalIgnoreCase)
&& this.coltyp == other.coltyp
&& this.isAscending == other.isAscending
&& this.isASCII == other.isASCII;
}
}
}

View File

@ -0,0 +1,337 @@
//-----------------------------------------------------------------------
// <copyright file="Instance.cs" company="Microsoft Corporation">
// Copyright (c) Microsoft Corporation.
// </copyright>
//-----------------------------------------------------------------------
namespace Microsoft.Isam.Esent.Interop
{
using System;
using System.Diagnostics.CodeAnalysis;
using System.Globalization;
using System.Runtime.CompilerServices;
using System.Security.Permissions;
using Microsoft.Isam.Esent.Interop.Vista;
using Microsoft.Win32.SafeHandles;
/// <summary>
/// A class that encapsulates a <see cref="JET_INSTANCE"/> in a disposable object. The
/// instance must be closed last and closing the instance releases all other
/// resources for the instance.
/// </summary>
public class Instance : SafeHandleZeroOrMinusOneIsInvalid
{
/// <summary>
/// Parameters for the instance.
/// </summary>
private readonly InstanceParameters parameters;
/// <summary>
/// The name of the instance.
/// </summary>
private readonly string name;
/// <summary>
/// The display name of the instance.
/// </summary>
private readonly string displayName;
/// <summary>
/// The TermGrbit to be used at JetTerm time.
/// </summary>
private TermGrbit termGrbit;
/// <summary>
/// Initializes a new instance of the Instance class. The underlying
/// JET_INSTANCE is allocated, but not initialized.
/// </summary>
/// <param name="name">
/// The name of the instance. This string must be unique within a
/// given process hosting the database engine.
/// </param>
[SecurityPermissionAttribute(SecurityAction.LinkDemand)]
public Instance(string name) : this(name, name, TermGrbit.None)
{
}
/// <summary>
/// Initializes a new instance of the Instance class. The underlying
/// JET_INSTANCE is allocated, but not initialized.
/// </summary>
/// <param name="name">
/// The name of the instance. This string must be unique within a
/// given process hosting the database engine.
/// </param>
/// <param name="displayName">
/// A display name for the instance. This will be used in eventlog
/// entries.
/// </param>
[SecurityPermissionAttribute(SecurityAction.LinkDemand)]
public Instance(string name, string displayName) : this(name, displayName, TermGrbit.None)
{
}
/// <summary>
/// Initializes a new instance of the Instance class. The underlying
/// JET_INSTANCE is allocated, but not initialized.
/// </summary>
/// <param name="name">
/// The name of the instance. This string must be unique within a
/// given process hosting the database engine.
/// </param>
/// <param name="displayName">
/// A display name for the instance. This will be used in eventlog
/// entries.
/// </param>
/// <param name="termGrbit">
/// The TermGrbit to be used at JetTerm time.
/// </param>
[SecurityPermissionAttribute(SecurityAction.LinkDemand)]
public Instance(string name, string displayName, TermGrbit termGrbit) : base(true)
{
this.name = name;
this.displayName = displayName;
this.termGrbit = termGrbit;
JET_INSTANCE instance;
RuntimeHelpers.PrepareConstrainedRegions();
try
{
this.SetHandle(JET_INSTANCE.Nil.Value);
}
finally
{
// This is the code that we want in a constrained execution region.
// We need to avoid the situation where JetCreateInstance2 is called
// but the handle isn't set, so the instance is never terminated.
// This would happen, for example, if there was a ThreadAbortException
// between the call to JetCreateInstance2 and the call to SetHandle.
//
// If an Esent exception is generated we do not want to call SetHandle
// because the instance isn't valid. On the other hand if a different
// exception (out of memory or thread abort) is generated we still need
// to set the handle to avoid losing track of the instance. The call to
// JetCreateInstance2 is in the CER to make sure that the only exceptions
// which can be generated are from ESENT failures.
Api.JetCreateInstance2(out instance, this.name, this.displayName, CreateInstanceGrbit.None);
this.SetHandle(instance.Value);
}
this.parameters = new InstanceParameters(instance);
}
/// <summary>
/// Gets the JET_INSTANCE that this instance contains.
/// </summary>
public JET_INSTANCE JetInstance
{
[SecurityPermissionAttribute(SecurityAction.LinkDemand)]
get
{
this.CheckObjectIsNotDisposed();
return this.CreateInstanceFromHandle();
}
}
/// <summary>
/// Gets the InstanceParameters for this instance.
/// </summary>
public InstanceParameters Parameters
{
[SecurityPermissionAttribute(SecurityAction.LinkDemand)]
get
{
this.CheckObjectIsNotDisposed();
return this.parameters;
}
}
/// <summary>
/// Gets or sets the TermGrbit for this instance.
/// </summary>
public TermGrbit TermGrbit
{
[SecurityPermissionAttribute(SecurityAction.LinkDemand)]
get
{
this.CheckObjectIsNotDisposed();
return this.termGrbit;
}
[SecurityPermissionAttribute(SecurityAction.LinkDemand)]
set
{
this.CheckObjectIsNotDisposed();
this.termGrbit = value;
}
}
/// <summary>
/// Provide implicit conversion of an Instance object to a JET_INSTANCE
/// structure. This is done so that an Instance can be used anywhere a
/// JET_INSTANCE is required.
/// </summary>
/// <param name="instance">The instance to convert.</param>
/// <returns>The JET_INSTANCE wrapped by the instance.</returns>
[SecurityPermissionAttribute(SecurityAction.LinkDemand)]
public static implicit operator JET_INSTANCE(Instance instance)
{
return instance.JetInstance;
}
/// <summary>
/// Returns a <see cref="T:System.String"/> that represents the current <see cref="Instance"/>.
/// </summary>
/// <returns>
/// A <see cref="T:System.String"/> that represents the current <see cref="Instance"/>.
/// </returns>
public override string ToString()
{
return string.Format(CultureInfo.InvariantCulture, "{0} ({1})", this.displayName, this.name);
}
/// <summary>
/// Initialize the JET_INSTANCE.
/// </summary>
[SecurityPermissionAttribute(SecurityAction.LinkDemand)]
public void Init()
{
this.Init(InitGrbit.None);
}
/// <summary>
/// Initialize the JET_INSTANCE.
/// </summary>
/// <param name="grbit">
/// Initialization options.
/// </param>
[SecurityPermissionAttribute(SecurityAction.LinkDemand)]
public void Init(InitGrbit grbit)
{
this.CheckObjectIsNotDisposed();
JET_INSTANCE instance = this.JetInstance;
// Use a constrained region so that the handle is
// always set after JetInit2 is called.
RuntimeHelpers.PrepareConstrainedRegions();
try
{
// Remember that a failure in JetInit can zero the handle
// and that JetTerm should not be called in that case.
Api.JetInit2(ref instance, grbit);
}
finally
{
this.SetHandle(instance.Value);
}
}
/// <summary>
/// Initialize the JET_INSTANCE. This API requires at least the
/// Vista version of ESENT.
/// </summary>
/// <param name="recoveryOptions">
/// Additional recovery parameters for remapping databases during
/// recovery, position where to stop recovery at, or recovery status.
/// </param>
/// <param name="grbit">
/// Initialization options.
/// </param>
[SecurityPermissionAttribute(SecurityAction.LinkDemand)]
public void Init(JET_RSTINFO recoveryOptions, InitGrbit grbit)
{
this.CheckObjectIsNotDisposed();
JET_INSTANCE instance = this.JetInstance;
// Use a constrained region so that the handle is
// always set after JetInit3 is called.
RuntimeHelpers.PrepareConstrainedRegions();
try
{
// Remember that a failure in JetInit can zero the handle
// and that JetTerm should not be called in that case.
VistaApi.JetInit3(ref instance, recoveryOptions, grbit);
}
finally
{
this.SetHandle(instance.Value);
}
}
/// <summary>
/// Terminate the JET_INSTANCE.
/// </summary>
[SuppressMessage(
"Microsoft.StyleCop.CSharp.MaintainabilityRules",
"SA1409:RemoveUnnecessaryCode",
Justification = "CER code belongs in the finally block, so the try clause is empty")]
[SecurityPermissionAttribute(SecurityAction.LinkDemand)]
public void Term()
{
// Use a constrained region so that the handle is
// always set as invalid after JetTerm is called.
RuntimeHelpers.PrepareConstrainedRegions();
try
{
// This try block deliberately left blank.
}
finally
{
// This is the code that we want in a constrained execution region.
// We need to avoid the situation where JetTerm is called
// but the handle isn't invalidated, so the instance is terminated again.
// This would happen, for example, if there was a ThreadAbortException
// between the call to JetTerm and the call to SetHandle.
//
// If an Esent exception is generated we do not want to invalidate the handle
// because the instance isn't necessarily terminated. On the other hand if a
// different exception (out of memory or thread abort) is generated we still need
// to invalidate the handle.
try
{
Api.JetTerm2(this.JetInstance, this.termGrbit);
}
catch (EsentDirtyShutdownException)
{
this.SetHandleAsInvalid();
throw;
}
this.SetHandleAsInvalid();
}
}
/// <summary>
/// Release the handle for this instance.
/// </summary>
/// <returns>True if the handle could be released.</returns>
protected override bool ReleaseHandle()
{
// The object is already marked as invalid so don't check
var instance = this.CreateInstanceFromHandle();
return (int)JET_err.Success == Api.Impl.JetTerm2(instance, this.termGrbit);
}
/// <summary>
/// Create a JET_INSTANCE from the internal handle value.
/// </summary>
/// <returns>A JET_INSTANCE containing the internal handle.</returns>
private JET_INSTANCE CreateInstanceFromHandle()
{
return new JET_INSTANCE { Value = this.handle };
}
/// <summary>
/// Check to see if this instance is invalid or closed.
/// </summary>
[SecurityPermissionAttribute(SecurityAction.LinkDemand)]
private void CheckObjectIsNotDisposed()
{
if (this.IsInvalid || this.IsClosed)
{
throw new ObjectDisposedException("Instance");
}
}
}
}

View File

@ -0,0 +1,762 @@
//-----------------------------------------------------------------------
// <copyright file="InstanceParameters.cs" company="Microsoft Corporation">
// Copyright (c) Microsoft Corporation.
// </copyright>
//-----------------------------------------------------------------------
namespace Microsoft.Isam.Esent.Interop
{
using System;
using System.Globalization;
using System.IO;
using Microsoft.Isam.Esent.Interop.Server2003;
using Microsoft.Isam.Esent.Interop.Vista;
using Microsoft.Isam.Esent.Interop.Windows7;
/// <summary>
/// This class provides properties to set and get system parameters
/// on an ESENT instance.
/// </summary>
public partial class InstanceParameters
{
/// <summary>
/// The instance to set parameters on.
/// </summary>
private readonly JET_INSTANCE instance;
/// <summary>
/// The session to set parameters with.
/// </summary>
private readonly JET_SESID sesid;
/// <summary>
/// Initializes a new instance of the InstanceParameters class.
/// </summary>
/// <param name="instance">
/// The instance to set parameters on. If this is JET_INSTANCE.Nil,
/// then the settings affect the default settings of future instances.
/// </param>
public InstanceParameters(JET_INSTANCE instance)
{
this.instance = instance;
this.sesid = JET_SESID.Nil;
}
/// <summary>
/// Gets or sets the relative or absolute file system path of the
/// folder that will contain the checkpoint file for the instance.
/// </summary>
public string SystemDirectory
{
get
{
return Util.AddTrailingDirectorySeparator(this.GetStringParameter(JET_param.SystemPath));
}
set
{
this.SetStringParameter(JET_param.SystemPath, Util.AddTrailingDirectorySeparator(value));
}
}
/// <summary>
/// Gets or sets the relative or absolute file system path of
/// the folder that will contain the temporary database for the instance.
/// </summary>
public string TempDirectory
{
get
{
// Older versions of Esent (e.g. Windows XP) will return the
// full path of the temporary database. Extract the directory name.
string path = this.GetStringParameter(JET_param.TempPath);
string dir = Path.GetDirectoryName(path);
return Util.AddTrailingDirectorySeparator(dir);
}
set
{
this.SetStringParameter(JET_param.TempPath, Util.AddTrailingDirectorySeparator(value));
}
}
/// <summary>
/// Gets or sets the relative or absolute file system path of the
/// folder that will contain the transaction logs for the instance.
/// </summary>
public string LogFileDirectory
{
get
{
return Util.AddTrailingDirectorySeparator(this.GetStringParameter(JET_param.LogFilePath));
}
set
{
this.SetStringParameter(JET_param.LogFilePath, Util.AddTrailingDirectorySeparator(value));
}
}
/// <summary>
/// Gets or sets the relative or absolute file system path of the
/// a folder where crash recovery or a restore operation can find
/// the databases referenced in the transaction log in the
/// specified folder.
/// </summary>
/// <remarks>
/// This parameter is ignored on Windows XP.
/// </remarks>
public string AlternateDatabaseRecoveryDirectory
{
get
{
if (EsentVersion.SupportsServer2003Features)
{
return
Util.AddTrailingDirectorySeparator(
this.GetStringParameter(Server2003Param.AlternateDatabaseRecoveryPath));
}
return null;
}
set
{
if (EsentVersion.SupportsServer2003Features)
{
this.SetStringParameter(
Server2003Param.AlternateDatabaseRecoveryPath, Util.AddTrailingDirectorySeparator(value));
}
}
}
/// <summary>
/// Gets or sets the three letter prefix used for many of the files used by
/// the database engine. For example, the checkpoint file is called EDB.CHK by
/// default because EDB is the default base name.
/// </summary>
public string BaseName
{
get
{
return this.GetStringParameter(JET_param.BaseName);
}
set
{
this.SetStringParameter(JET_param.BaseName, value);
}
}
/// <summary>
/// Gets or sets an application specific string that will be added to
/// any event log messages that are emitted by the database engine. This allows
/// easy correlation of event log messages with the source application. By default
/// the host application executable name will be used.
/// </summary>
public string EventSource
{
get
{
return this.GetStringParameter(JET_param.EventSource);
}
set
{
this.SetStringParameter(JET_param.EventSource, value);
}
}
/// <summary>
/// Gets or sets the number of sessions resources reserved for this instance.
/// A session resource directly corresponds to a JET_SESID.
/// </summary>
public int MaxSessions
{
get
{
return this.GetIntegerParameter(JET_param.MaxSessions);
}
set
{
this.SetIntegerParameter(JET_param.MaxSessions, value);
}
}
/// <summary>
/// Gets or sets the number of B+ Tree resources reserved for this instance.
/// </summary>
public int MaxOpenTables
{
get
{
return this.GetIntegerParameter(JET_param.MaxOpenTables);
}
set
{
this.SetIntegerParameter(JET_param.MaxOpenTables, value);
}
}
/// <summary>
/// Gets or sets the number of cursor resources reserved for this instance.
/// A cursor resource directly corresponds to a JET_TABLEID.
/// </summary>
public int MaxCursors
{
get
{
return this.GetIntegerParameter(JET_param.MaxCursors);
}
set
{
this.SetIntegerParameter(JET_param.MaxCursors, value);
}
}
/// <summary>
/// Gets or sets the maximum number of version store pages reserved
/// for this instance.
/// </summary>
public int MaxVerPages
{
get
{
return this.GetIntegerParameter(JET_param.MaxVerPages);
}
set
{
this.SetIntegerParameter(JET_param.MaxVerPages, value);
}
}
/// <summary>
/// Gets or sets the preferred number of version store pages reserved
/// for this instance. If the size of the version store exceeds this
/// threshold then any information that is only used for optional
/// background tasks, such as reclaiming deleted space in the database,
/// is instead sacrificed to preserve room for transactional information.
/// </summary>
public int PreferredVerPages
{
get
{
return this.GetIntegerParameter(JET_param.PreferredVerPages);
}
set
{
this.SetIntegerParameter(JET_param.PreferredVerPages, value);
}
}
/// <summary>
/// Gets or sets the the number of background cleanup work items that
/// can be queued to the database engine thread pool at any one time.
/// </summary>
public int VersionStoreTaskQueueMax
{
get
{
return this.GetIntegerParameter(JET_param.VersionStoreTaskQueueMax);
}
set
{
this.SetIntegerParameter(JET_param.VersionStoreTaskQueueMax, value);
}
}
/// <summary>
/// Gets or sets the number of temporary table resources for use
/// by an instance. This setting will affect how many temporary tables can be used at
/// the same time. If this system parameter is set to zero then no temporary database
/// will be created and any activity that requires use of the temporary database will
/// fail. This setting can be useful to avoid the I/O required to create the temporary
/// database if it is known that it will not be used.
/// </summary>
/// <remarks>
/// The use of a temporary table also requires a cursor resource.
/// </remarks>
public int MaxTemporaryTables
{
get
{
return this.GetIntegerParameter(JET_param.MaxTemporaryTables);
}
set
{
this.SetIntegerParameter(JET_param.MaxTemporaryTables, value);
}
}
/// <summary>
/// Gets or sets the size of the transaction log files. This parameter
/// should be set in units of 1024 bytes (e.g. a setting of 2048 will
/// give 2MB logfiles).
/// </summary>
public int LogFileSize
{
get
{
return this.GetIntegerParameter(JET_param.LogFileSize);
}
set
{
this.SetIntegerParameter(JET_param.LogFileSize, value);
}
}
/// <summary>
/// Gets or sets the amount of memory used to cache log records
/// before they are written to the transaction log file. The unit for this
/// parameter is the sector size of the volume that holds the transaction log files.
/// The sector size is almost always 512 bytes, so it is safe to assume that size
/// for the unit. This parameter has an impact on performance. When the database
/// engine is under heavy update load, this buffer can become full very rapidly.
/// A larger cache size for the transaction log file is critical for good update
/// performance under such a high load condition. The default is known to be too small
/// for this case.
/// Do not set this parameter to a number of buffers that is larger (in bytes) than
/// half the size of a transaction log file.
/// </summary>
public int LogBuffers
{
get
{
return this.GetIntegerParameter(JET_param.LogBuffers);
}
set
{
this.SetIntegerParameter(JET_param.LogBuffers, value);
}
}
/// <summary>
/// Gets or sets a value indicating whether circular logging is on.
/// When circular logging is off, all transaction log files that are generated
/// are retained on disk until they are no longer needed because a full backup of the
/// database has been performed. When circular logging is on, only transaction log files
/// that are younger than the current checkpoint are retained on disk. The benefit of
/// this mode is that backups are not required to retire old transaction log files.
/// </summary>
public bool CircularLog
{
get
{
return this.GetBoolParameter(JET_param.CircularLog);
}
set
{
this.SetBoolParameter(JET_param.CircularLog, value);
}
}
/// <summary>
/// Gets or sets a value indicating whether JetInit fails when the database
/// engine is configured to start using transaction log files on disk
/// that are of a different size than what is configured. Normally,
/// <see cref="Api.JetInit"/> will successfully recover the databases
/// but will fail with <see cref="JET_err.LogFileSizeMismatchDatabasesConsistent"/>
/// to indicate that the log file size is misconfigured. However, when
/// this parameter is set to true then the database engine will silently
/// delete all the old log files, start a new set of transaction log files
/// using the configured log file size. This parameter is useful when the
/// application wishes to transparently change its transaction log file
/// size yet still work transparently in upgrade and restore scenarios.
/// </summary>
public bool CleanupMismatchedLogFiles
{
get
{
return this.GetBoolParameter(JET_param.CleanupMismatchedLogFiles);
}
set
{
this.SetBoolParameter(JET_param.CleanupMismatchedLogFiles, value);
}
}
/// <summary>
/// Gets or sets the initial size of the temporary database. The size is in
/// database pages. A size of zero indicates that the default size of an ordinary
/// database should be used. It is often desirable for small applications to configure
/// the temporary database to be as small as possible. Setting this parameter to
/// <see cref="SystemParameters.PageTempDBSmallest"/> will achieve the smallest
/// temporary database possible.
/// </summary>
public int PageTempDBMin
{
get
{
return this.GetIntegerParameter(JET_param.PageTempDBMin);
}
set
{
this.SetIntegerParameter(JET_param.PageTempDBMin, value);
}
}
/// <summary>
/// Gets or sets the threshold in bytes for about how many transaction log
/// files will need to be replayed after a crash. If circular logging is enabled using
/// CircularLog then this parameter will also control the approximate amount
/// of transaction log files that will be retained on disk.
/// </summary>
public int CheckpointDepthMax
{
get
{
return this.GetIntegerParameter(JET_param.CheckpointDepthMax);
}
set
{
this.SetIntegerParameter(JET_param.CheckpointDepthMax, value);
}
}
/// <summary>
/// Gets or sets the number of pages that are added to a database file each
/// time it needs to grow to accommodate more data.
/// </summary>
public int DbExtensionSize
{
get
{
return this.GetIntegerParameter(JET_param.DbExtensionSize);
}
set
{
this.SetIntegerParameter(JET_param.DbExtensionSize, value);
}
}
/// <summary>
/// Gets or sets a value indicating whether crash recovery is on.
/// </summary>
public bool Recovery
{
get
{
return 0 == string.Compare(this.GetStringParameter(JET_param.Recovery), "on", StringComparison.OrdinalIgnoreCase);
}
set
{
if (value)
{
this.SetStringParameter(JET_param.Recovery, "on");
}
else
{
this.SetStringParameter(JET_param.Recovery, "off");
}
}
}
/// <summary>
/// Gets or sets a value indicating whether online defragmentation is enabled.
/// </summary>
public bool EnableOnlineDefrag
{
get
{
return this.GetBoolParameter(JET_param.EnableOnlineDefrag);
}
set
{
this.SetBoolParameter(JET_param.EnableOnlineDefrag, value);
}
}
/// <summary>
/// Gets or sets a value indicating whether <see cref="Api.JetAttachDatabase"/> will check for
/// indexes that were build using an older version of the NLS library in the
/// operating system.
/// </summary>
public bool EnableIndexChecking
{
get
{
return this.GetBoolParameter(JET_param.EnableIndexChecking);
}
set
{
this.SetBoolParameter(JET_param.EnableIndexChecking, value);
}
}
/// <summary>
/// Gets or sets the name of the event log the database engine uses for its event log
/// messages. By default, all event log messages will go to the Application event log. If the registry
/// key name for another event log is configured then the event log messages will go there instead.
/// </summary>
public string EventSourceKey
{
get
{
return this.GetStringParameter(JET_param.EventSourceKey);
}
set
{
this.SetStringParameter(JET_param.EventSourceKey, value);
}
}
/// <summary>
/// Gets or sets a value indicating whether informational event
/// log messages that would ordinarily be generated by the
/// database engine will be suppressed.
/// </summary>
public bool NoInformationEvent
{
get
{
return this.GetBoolParameter(JET_param.NoInformationEvent);
}
set
{
this.SetBoolParameter(JET_param.NoInformationEvent, value);
}
}
/// <summary>
/// Gets or sets the detail level of eventlog messages that are emitted
/// to the eventlog by the database engine. Higher numbers will result
/// in more detailed eventlog messages.
/// </summary>
public EventLoggingLevels EventLoggingLevel
{
get
{
return (EventLoggingLevels)this.GetIntegerParameter(JET_param.EventLoggingLevel);
}
set
{
this.SetIntegerParameter(JET_param.EventLoggingLevel, (int)value);
}
}
/// <summary>
/// Gets or sets a value indicating whether only one database is allowed to
/// be opened using JetOpenDatabase by a given session at one time.
/// The temporary database is excluded from this restriction.
/// </summary>
public bool OneDatabasePerSession
{
get
{
return this.GetBoolParameter(JET_param.OneDatabasePerSession);
}
set
{
this.SetBoolParameter(JET_param.OneDatabasePerSession, value);
}
}
/// <summary>
/// Gets or sets a value indicating whether ESENT will silently create folders
/// that are missing in its filesystem paths.
/// </summary>
public bool CreatePathIfNotExist
{
get
{
return this.GetBoolParameter(JET_param.CreatePathIfNotExist);
}
set
{
this.SetBoolParameter(JET_param.CreatePathIfNotExist, value);
}
}
/// <summary>
/// Gets or sets a value giving the number of B+ Tree resources cached by
/// the instance after the tables they represent have been closed by
/// the application. Large values for this parameter will cause the
/// database engine to use more memory but will increase the speed
/// with which a large number of tables can be opened randomly by
/// the application. This is useful for applications that have a
/// schema with a very large number of tables.
/// <para>
/// Supported on Windows Vista and up. Ignored on Windows XP and
/// Windows Server 2003.
/// </para>
/// </summary>
public int CachedClosedTables
{
get
{
if (EsentVersion.SupportsVistaFeatures)
{
return this.GetIntegerParameter(VistaParam.CachedClosedTables);
}
return 0;
}
set
{
if (EsentVersion.SupportsVistaFeatures)
{
this.SetIntegerParameter(VistaParam.CachedClosedTables, value);
}
}
}
/// <summary>
/// Gets or sets a the number of logs that esent will defer database
/// flushes for. This can be used to increase database recoverability if
/// failures cause logfiles to be lost.
/// <para>
/// Supported on Windows 7 and up. Ignored on Windows XP,
/// Windows Server 2003, Windows Vista and Windows Server 2008.
/// </para>
/// </summary>
public int WaypointLatency
{
get
{
if (EsentVersion.SupportsWindows7Features)
{
return this.GetIntegerParameter(Windows7Param.WaypointLatency);
}
// older versions have no waypoint
return 0;
}
set
{
if (EsentVersion.SupportsWindows7Features)
{
this.SetIntegerParameter(Windows7Param.WaypointLatency, value);
}
}
}
/// <summary>
/// Gets or sets a value indicating whether <see cref="Api.JetAttachDatabase"/> will
/// delete indexes that were build using an older version of the NLS library in the
/// operating system.
/// </summary>
public bool EnableIndexCleanup
{
get
{
return this.GetBoolParameter(JET_param.EnableIndexCleanup);
}
set
{
this.SetBoolParameter(JET_param.EnableIndexCleanup, value);
}
}
/// <summary>
/// Returns a <see cref="T:System.String"/> that represents the current <see cref="InstanceParameters"/>.
/// </summary>
/// <returns>
/// A <see cref="T:System.String"/> that represents the current <see cref="InstanceParameters"/>.
/// </returns>
public override string ToString()
{
return string.Format(CultureInfo.InvariantCulture, "InstanceParameters (0x{0:x})", this.instance.Value);
}
/// <summary>
/// Set a system parameter which is a string.
/// </summary>
/// <param name="param">The parameter to set.</param>
/// <param name="value">The value to set.</param>
private void SetStringParameter(JET_param param, string value)
{
Api.JetSetSystemParameter(this.instance, this.sesid, param, 0, value);
}
/// <summary>
/// Get a system parameter which is a string.
/// </summary>
/// <param name="param">The parameter to get.</param>
/// <returns>The value of the parameter.</returns>
private string GetStringParameter(JET_param param)
{
int ignored = 0;
string value;
Api.JetGetSystemParameter(this.instance, this.sesid, param, ref ignored, out value, 1024);
return value;
}
/// <summary>
/// Set a system parameter which is an integer.
/// </summary>
/// <param name="param">The parameter to set.</param>
/// <param name="value">The value to set.</param>
private void SetIntegerParameter(JET_param param, int value)
{
Api.JetSetSystemParameter(this.instance, this.sesid, param, value, null);
}
/// <summary>
/// Get a system parameter which is an integer.
/// </summary>
/// <param name="param">The parameter to get.</param>
/// <returns>The value of the parameter.</returns>
private int GetIntegerParameter(JET_param param)
{
int value = 0;
string ignored;
Api.JetGetSystemParameter(this.instance, this.sesid, param, ref value, out ignored, 0);
return value;
}
/// <summary>
/// Set a system parameter which is a boolean.
/// </summary>
/// <param name="param">The parameter to set.</param>
/// <param name="value">The value to set.</param>
private void SetBoolParameter(JET_param param, bool value)
{
if (value)
{
Api.JetSetSystemParameter(this.instance, this.sesid, param, 1, null);
}
else
{
Api.JetSetSystemParameter(this.instance, this.sesid, param, 0, null);
}
}
/// <summary>
/// Get a system parameter which is a boolean.
/// </summary>
/// <param name="param">The parameter to get.</param>
/// <returns>The value of the parameter.</returns>
private bool GetBoolParameter(JET_param param)
{
int value = 0;
string ignored;
Api.JetGetSystemParameter(this.instance, this.sesid, param, ref value, out ignored, 0);
return value != 0;
}
}
}

View File

@ -0,0 +1,69 @@
//-----------------------------------------------------------------------
// <copyright file="Int16ColumnValue.cs" company="Microsoft Corporation">
// Copyright (c) Microsoft Corporation.
// </copyright>
//-----------------------------------------------------------------------
namespace Microsoft.Isam.Esent.Interop
{
using System;
using System.Diagnostics;
/// <summary>
/// An <see cref="short"/> column value.
/// </summary>
public class Int16ColumnValue : ColumnValueOfStruct<short>
{
/// <summary>
/// Gets the size of the value in the column. This returns 0 for
/// variable sized columns (i.e. binary and string).
/// </summary>
protected override int Size
{
[DebuggerStepThrough]
get { return sizeof(short); }
}
/// <summary>
/// Recursive SetColumns method for data pinning. This populates the buffer and
/// calls the inherited SetColumns method.
/// </summary>
/// <param name="sesid">The session to use.</param>
/// <param name="tableid">
/// The table to set the columns in. An update should be prepared.
/// </param>
/// <param name="columnValues">
/// Column values to set.
/// </param>
/// <param name="nativeColumns">
/// Structures to put the pinned data in.
/// </param>
/// <param name="i">Offset of this object in the array.</param>
/// <returns>An error code.</returns>
internal override unsafe int SetColumns(JET_SESID sesid, JET_TABLEID tableid, ColumnValue[] columnValues, NATIVE_SETCOLUMN* nativeColumns, int i)
{
var data = this.Value.GetValueOrDefault();
return this.SetColumns(sesid, tableid, columnValues, nativeColumns, i, &data, sizeof(short), this.Value.HasValue);
}
/// <summary>
/// Given data retrieved from ESENT, decode the data and set the value in the ColumnValue object.
/// </summary>
/// <param name="value">An array of bytes.</param>
/// <param name="startIndex">The starting position within the bytes.</param>
/// <param name="count">The number of bytes to decode.</param>
/// <param name="err">The error returned from ESENT.</param>
protected override void GetValueFromBytes(byte[] value, int startIndex, int count, int err)
{
if (JET_wrn.ColumnNull == (JET_wrn)err)
{
this.Value = null;
}
else
{
this.CheckDataCount(count);
this.Value = BitConverter.ToInt16(value, startIndex);
}
}
}
}

View File

@ -0,0 +1,69 @@
//-----------------------------------------------------------------------
// <copyright file="Int32ColumnValue.cs" company="Microsoft Corporation">
// Copyright (c) Microsoft Corporation.
// </copyright>
//-----------------------------------------------------------------------
namespace Microsoft.Isam.Esent.Interop
{
using System;
using System.Diagnostics;
/// <summary>
/// An <see cref="int"/> column value.
/// </summary>
public class Int32ColumnValue : ColumnValueOfStruct<int>
{
/// <summary>
/// Gets the size of the value in the column. This returns 0 for
/// variable sized columns (i.e. binary and string).
/// </summary>
protected override int Size
{
[DebuggerStepThrough]
get { return sizeof(int); }
}
/// <summary>
/// Recursive SetColumns method for data pinning. This populates the buffer and
/// calls the inherited SetColumns method.
/// </summary>
/// <param name="sesid">The session to use.</param>
/// <param name="tableid">
/// The table to set the columns in. An update should be prepared.
/// </param>
/// <param name="columnValues">
/// Column values to set.
/// </param>
/// <param name="nativeColumns">
/// Structures to put the pinned data in.
/// </param>
/// <param name="i">Offset of this object in the array.</param>
/// <returns>An error code.</returns>
internal override unsafe int SetColumns(JET_SESID sesid, JET_TABLEID tableid, ColumnValue[] columnValues, NATIVE_SETCOLUMN* nativeColumns, int i)
{
var data = this.Value.GetValueOrDefault();
return this.SetColumns(sesid, tableid, columnValues, nativeColumns, i, &data, sizeof(int), this.Value.HasValue);
}
/// <summary>
/// Given data retrieved from ESENT, decode the data and set the value in the ColumnValue object.
/// </summary>
/// <param name="value">An array of bytes.</param>
/// <param name="startIndex">The starting position within the bytes.</param>
/// <param name="count">The number of bytes to decode.</param>
/// <param name="err">The error returned from ESENT.</param>
protected override void GetValueFromBytes(byte[] value, int startIndex, int count, int err)
{
if (JET_wrn.ColumnNull == (JET_wrn)err)
{
this.Value = null;
}
else
{
this.CheckDataCount(count);
this.Value = BitConverter.ToInt32(value, startIndex);
}
}
}
}

View File

@ -0,0 +1,69 @@
//-----------------------------------------------------------------------
// <copyright file="Int64ColumnValue.cs" company="Microsoft Corporation">
// Copyright (c) Microsoft Corporation.
// </copyright>
//-----------------------------------------------------------------------
namespace Microsoft.Isam.Esent.Interop
{
using System;
using System.Diagnostics;
/// <summary>
/// An <see cref="long"/> column value.
/// </summary>
public class Int64ColumnValue : ColumnValueOfStruct<long>
{
/// <summary>
/// Gets the size of the value in the column. This returns 0 for
/// variable sized columns (i.e. binary and string).
/// </summary>
protected override int Size
{
[DebuggerStepThrough]
get { return sizeof(long); }
}
/// <summary>
/// Recursive SetColumns method for data pinning. This populates the buffer and
/// calls the inherited SetColumns method.
/// </summary>
/// <param name="sesid">The session to use.</param>
/// <param name="tableid">
/// The table to set the columns in. An update should be prepared.
/// </param>
/// <param name="columnValues">
/// Column values to set.
/// </param>
/// <param name="nativeColumns">
/// Structures to put the pinned data in.
/// </param>
/// <param name="i">Offset of this object in the array.</param>
/// <returns>An error code.</returns>
internal override unsafe int SetColumns(JET_SESID sesid, JET_TABLEID tableid, ColumnValue[] columnValues, NATIVE_SETCOLUMN* nativeColumns, int i)
{
var data = this.Value.GetValueOrDefault();
return this.SetColumns(sesid, tableid, columnValues, nativeColumns, i, &data, sizeof(long), this.Value.HasValue);
}
/// <summary>
/// Given data retrieved from ESENT, decode the data and set the value in the ColumnValue object.
/// </summary>
/// <param name="value">An array of bytes.</param>
/// <param name="startIndex">The starting position within the bytes.</param>
/// <param name="count">The number of bytes to decode.</param>
/// <param name="err">The error returned from ESENT.</param>
protected override void GetValueFromBytes(byte[] value, int startIndex, int count, int err)
{
if (JET_wrn.ColumnNull == (JET_wrn)err)
{
this.Value = null;
}
else
{
this.CheckDataCount(count);
this.Value = BitConverter.ToInt64(value, startIndex);
}
}
}
}

View File

@ -0,0 +1,192 @@
//-----------------------------------------------------------------------
// <copyright file="InternalApi.cs" company="Microsoft Corporation">
// Copyright (c) Microsoft Corporation.
// </copyright>
//-----------------------------------------------------------------------
namespace Microsoft.Isam.Esent.Interop
{
using System;
/// <summary>
/// Internal-only methods of the Api.
/// </summary>
public static partial class Api
{
/// <summary>
/// The JetSetColumn function modifies a single column value in a modified record to be inserted or to
/// update the current record. It can overwrite an existing value, add a new value to a sequence of
/// values in a multi-valued column, remove a value from a sequence of values in a multi-valued column,
/// or update all or part of a long value (a column of type <see cref="JET_coltyp.LongText"/>
/// or <see cref="JET_coltyp.LongBinary"/>).
/// </summary>
/// <remarks>
/// This is an internal-only version of the API that takes a data buffer and an offset into the buffer.
/// </remarks>
/// <param name="sesid">The session which is performing the update.</param>
/// <param name="tableid">The cursor to update. An update should be prepared.</param>
/// <param name="columnid">The columnid to set.</param>
/// <param name="data">The data to set.</param>
/// <param name="dataSize">The size of data to set.</param>
/// <param name="dataOffset">The offset in the data buffer to set data from.</param>
/// <param name="grbit">SetColumn options.</param>
/// <param name="setinfo">Used to specify itag or long-value offset.</param>
/// <returns>A warning value.</returns>
public static JET_wrn JetSetColumn(JET_SESID sesid, JET_TABLEID tableid, JET_COLUMNID columnid, byte[] data, int dataSize, int dataOffset, SetColumnGrbit grbit, JET_SETINFO setinfo)
{
if (dataOffset < 0
|| (null != data && 0 != dataSize && dataOffset >= data.Length)
|| (null == data && dataOffset != 0))
{
throw new ArgumentOutOfRangeException(
"dataOffset",
dataOffset,
"must be inside the data buffer");
}
if (null != data && dataSize > checked(data.Length - dataOffset) && (SetColumnGrbit.SizeLV != (grbit & SetColumnGrbit.SizeLV)))
{
throw new ArgumentOutOfRangeException(
"dataSize",
dataSize,
"cannot be greater than the length of the data (unless the SizeLV option is used)");
}
unsafe
{
fixed (byte* pointer = data)
{
return Api.JetSetColumn(sesid, tableid, columnid, new IntPtr(pointer + dataOffset), dataSize, grbit, setinfo);
}
}
}
/// <summary>
/// Retrieves a single column value from the current record. The record is that
/// record associated with the index entry at the current position of the cursor.
/// Alternatively, this function can retrieve a column from a record being created
/// in the cursor copy buffer. This function can also retrieve column data from an
/// index entry that references the current record. In addition to retrieving the
/// actual column value, JetRetrieveColumn can also be used to retrieve the size
/// of a column, before retrieving the column data itself so that application
/// buffers can be sized appropriately.
/// </summary>
/// <remarks>
/// This is an internal method that takes a buffer offset as well as size.
/// </remarks>
/// <param name="sesid">The session to use.</param>
/// <param name="tableid">The cursor to retrieve the column from.</param>
/// <param name="columnid">The columnid to retrieve.</param>
/// <param name="data">The data buffer to be retrieved into.</param>
/// <param name="dataSize">The size of the data buffer.</param>
/// <param name="dataOffset">Offset into the data buffer to read data into.</param>
/// <param name="actualDataSize">Returns the actual size of the data buffer.</param>
/// <param name="grbit">Retrieve column options.</param>
/// <param name="retinfo">
/// If pretinfo is give as NULL then the function behaves as though an itagSequence
/// of 1 and an ibLongValue of 0 (zero) were given. This causes column retrieval to
/// retrieve the first value of a multi-valued column, and to retrieve long data at
/// offset 0 (zero).
/// </param>
/// <returns>An ESENT warning code.</returns>
public static JET_wrn JetRetrieveColumn(JET_SESID sesid, JET_TABLEID tableid, JET_COLUMNID columnid, byte[] data, int dataSize, int dataOffset, out int actualDataSize, RetrieveColumnGrbit grbit, JET_RETINFO retinfo)
{
if (dataOffset < 0
|| (null != data && 0 != dataSize && dataOffset >= data.Length)
|| (null == data && dataOffset != 0))
{
throw new ArgumentOutOfRangeException(
"dataOffset",
dataOffset,
"must be inside the data buffer");
}
if ((null == data && dataSize > 0) || (null != data && dataSize > data.Length))
{
throw new ArgumentOutOfRangeException(
"dataSize",
dataSize,
"cannot be greater than the length of the data");
}
unsafe
{
fixed (byte* pointer = data)
{
return Api.JetRetrieveColumn(
sesid, tableid, columnid, new IntPtr(pointer + dataOffset), dataSize, out actualDataSize, grbit, retinfo);
}
}
}
/// <summary>
/// Retrieves a single column value from the current record. The record is that
/// record associated with the index entry at the current position of the cursor.
/// Alternatively, this function can retrieve a column from a record being created
/// in the cursor copy buffer. This function can also retrieve column data from an
/// index entry that references the current record. In addition to retrieving the
/// actual column value, JetRetrieveColumn can also be used to retrieve the size
/// of a column, before retrieving the column data itself so that application
/// buffers can be sized appropriately.
/// </summary>
/// <remarks>
/// This is an internal-use version that takes an IntPtr.
/// </remarks>
/// <param name="sesid">The session to use.</param>
/// <param name="tableid">The cursor to retrieve the column from.</param>
/// <param name="columnid">The columnid to retrieve.</param>
/// <param name="data">The data buffer to be retrieved into.</param>
/// <param name="dataSize">The size of the data buffer.</param>
/// <param name="actualDataSize">Returns the actual size of the data buffer.</param>
/// <param name="grbit">Retrieve column options.</param>
/// <param name="retinfo">
/// If pretinfo is give as NULL then the function behaves as though an itagSequence
/// of 1 and an ibLongValue of 0 (zero) were given. This causes column retrieval to
/// retrieve the first value of a multi-valued column, and to retrieve long data at
/// offset 0 (zero).
/// </param>
/// <returns>An ESENT warning code.</returns>
internal static JET_wrn JetRetrieveColumn(JET_SESID sesid, JET_TABLEID tableid, JET_COLUMNID columnid, IntPtr data, int dataSize, out int actualDataSize, RetrieveColumnGrbit grbit, JET_RETINFO retinfo)
{
return Api.Check(Impl.JetRetrieveColumn(sesid, tableid, columnid, data, dataSize, out actualDataSize, grbit, retinfo));
}
/// <summary>
/// Constructs search keys that may then be used by JetSeek and JetSetIndexRange.
/// </summary>
/// <remarks>
/// This is an internal (unsafe) version that takes an IntPtr.
/// </remarks>
/// <param name="sesid">The session to use.</param>
/// <param name="tableid">The cursor to create the key on.</param>
/// <param name="data">Column data for the current key column of the current index.</param>
/// <param name="dataSize">Size of the data.</param>
/// <param name="grbit">Key options.</param>
internal static void JetMakeKey(JET_SESID sesid, JET_TABLEID tableid, IntPtr data, int dataSize, MakeKeyGrbit grbit)
{
Api.Check(Impl.JetMakeKey(sesid, tableid, data, dataSize, grbit));
}
/// <summary>
/// The JetSetColumn function modifies a single column value in a modified record to be inserted or to
/// update the current record. It can overwrite an existing value, add a new value to a sequence of
/// values in a multi-valued column, remove a value from a sequence of values in a multi-valued column,
/// or update all or part of a long value, a column of type JET_coltyp.LongText or JET_coltyp.LongBinary.
/// </summary>
/// <remarks>
/// This method takes an IntPtr and is intended for internal use only.
/// </remarks>
/// <param name="sesid">The session which is performing the update.</param>
/// <param name="tableid">The cursor to update. An update should be prepared.</param>
/// <param name="columnid">The columnid to set.</param>
/// <param name="data">The data to set.</param>
/// <param name="dataSize">The size of data to set.</param>
/// <param name="grbit">SetColumn options.</param>
/// <param name="setinfo">Used to specify itag or long-value offset.</param>
/// <returns>A warning value.</returns>
internal static JET_wrn JetSetColumn(JET_SESID sesid, JET_TABLEID tableid, JET_COLUMNID columnid, IntPtr data, int dataSize, SetColumnGrbit grbit, JET_SETINFO setinfo)
{
return Api.Check(Impl.JetSetColumn(sesid, tableid, columnid, data, dataSize, grbit, setinfo));
}
}
}

View File

@ -0,0 +1,56 @@
//-----------------------------------------------------------------------
// <copyright file="IntersectIndexesEnumerator.cs" company="Microsoft Corporation">
// Copyright (c) Microsoft Corporation.
// </copyright>
//-----------------------------------------------------------------------
namespace Microsoft.Isam.Esent.Interop
{
/// <summary>
/// Enumerator that can intersect indexes and return the intersected bookmarks.
/// </summary>
internal sealed class IntersectIndexesEnumerator : TableEnumerator<byte[]>
{
/// <summary>
/// The ranges to intersect.
/// </summary>
private readonly JET_INDEXRANGE[] ranges;
/// <summary>
/// The recordlist containing the result of the intersection.
/// </summary>
private JET_RECORDLIST recordlist;
/// <summary>
/// Initializes a new instance of the <see cref="IntersectIndexesEnumerator"/> class.
/// </summary>
/// <param name="sesid">
/// The session to use.
/// </param>
/// <param name="ranges">
/// The ranges to intersect.
/// </param>
public IntersectIndexesEnumerator(JET_SESID sesid, JET_INDEXRANGE[] ranges) : base(sesid)
{
this.ranges = ranges;
}
/// <summary>
/// Open the table to be enumerated. This should set <see cref="TableEnumerator{T}.TableidToEnumerate"/>.
/// </summary>
protected override void OpenTable()
{
Api.JetIntersectIndexes(this.Sesid, this.ranges, this.ranges.Length, out this.recordlist, IntersectIndexesGrbit.None);
this.TableidToEnumerate = this.recordlist.tableid;
}
/// <summary>
/// Gets the entry the cursor is currently positioned on.
/// </summary>
/// <returns>The entry the cursor is currently positioned on.</returns>
protected override byte[] GetCurrent()
{
return Api.RetrieveColumn(this.Sesid, this.TableidToEnumerate, this.recordlist.columnidBookmark);
}
}
}

View File

@ -0,0 +1,44 @@
//-----------------------------------------------------------------------
// <copyright file="JET_eventlogginglevel.cs" company="Microsoft Corporation">
// Copyright (c) Microsoft Corporation.
// </copyright>
//-----------------------------------------------------------------------
namespace Microsoft.Isam.Esent.Interop
{
/// <summary>
/// Options for EventLoggingLevel.
/// </summary>
public enum EventLoggingLevels
{
/// <summary>
/// Disable all events.
/// </summary>
Disable = 0,
/// <summary>
/// Default level. Windows 7 and later.
/// </summary>
Min = 1,
/// <summary>
/// Low verbosity and lower. Windows 7 and later.
/// </summary>
Low = 25,
/// <summary>
/// Medium verbosity and lower. Windows 7 and later.
/// </summary>
Medium = 50,
/// <summary>
/// High verbosity and lower. Windows 7 and later.
/// </summary>
High = 75,
/// <summary>
/// All events.
/// </summary>
Max = 100,
}
}

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,175 @@
//-----------------------------------------------------------------------
// <copyright file="JetCallbackWrapper.cs" company="Microsoft Corporation">
// Copyright (c) Microsoft Corporation.
// </copyright>
//-----------------------------------------------------------------------
namespace Microsoft.Isam.Esent.Interop
{
using System;
using System.Diagnostics;
using System.Globalization;
using System.Reflection;
using System.Runtime.CompilerServices;
/// <summary>
/// A multi-purpose callback function used by the database engine to inform
/// the application of an event involving online defragmentation and cursor
/// state notifications.
/// </summary>
/// <param name="sesid">The session for which the callback is being made.</param>
/// <param name="dbid">The database for which the callback is being made.</param>
/// <param name="tableid">The cursor for which the callback is being made.</param>
/// <param name="cbtyp">The operation for which the callback is being made.</param>
/// <param name="arg1">First callback-specific argument.</param>
/// <param name="arg2">Second callback-specific argument.</param>
/// <param name="context">Callback context.</param>
/// <param name="unused">This parameter is not used.</param>
/// <returns>An ESENT error code.</returns>
internal delegate JET_err NATIVE_CALLBACK(
IntPtr sesid,
uint dbid,
IntPtr tableid,
uint cbtyp,
IntPtr arg1,
IntPtr arg2,
IntPtr context,
IntPtr unused);
/// <summary>
/// Wraps a NATIVE_CALLBACK callback around a JET_CALLBACK. This is
/// used to catch exceptions and provide argument conversion.
/// </summary>
internal sealed class JetCallbackWrapper
{
/// <summary>
/// API call tracing.
/// </summary>
private static readonly TraceSwitch TraceSwitch = new TraceSwitch("ESENT JetCallbackWrapper", "Wrapper around unmanaged ESENT callback");
/// <summary>
/// The wrapped status callback.
/// </summary>
private readonly WeakReference wrappedCallback;
/// <summary>
/// The native version of the callback. This will actually be a closure
/// because we are calling a non-static method. Keep track of it here
/// to make sure that it isn't garbage collected.
/// </summary>
private readonly NATIVE_CALLBACK nativeCallback;
#if !MANAGEDESENT_ON_WSA
/// <summary>
/// Initializes static members of the <see cref="JetCallbackWrapper"/> class.
/// </summary>
static JetCallbackWrapper()
{
// We don't want a JIT failure when trying to execute the callback
// because that would throw an exception through ESENT, corrupting it.
// It is fine for the wrapped callback to fail because CallbackImpl
// will catch the exception and deal with it.
RuntimeHelpers.PrepareMethod(typeof(StatusCallbackWrapper).GetMethod(
"CallbackImpl",
BindingFlags.NonPublic | BindingFlags.Instance).MethodHandle);
}
#endif // !MANAGEDESENT_ON_WSA
/// <summary>
/// Initializes a new instance of the JetCallbackWrapper class.
/// </summary>
/// <param name="callback">
/// The managed callback to use.
/// </param>
public JetCallbackWrapper(JET_CALLBACK callback)
{
this.wrappedCallback = new WeakReference(callback);
this.nativeCallback = this.CallbackImpl;
Debug.Assert(this.wrappedCallback.IsAlive, "Callback isn't alive");
}
/// <summary>
/// Gets a value indicating whether the wrapped callback has been garbage
/// collected.
/// </summary>
public bool IsAlive
{
get
{
return this.wrappedCallback.IsAlive;
}
}
/// <summary>
/// Gets a NATIVE_CALLBACK callback that wraps the managed callback.
/// </summary>
public NATIVE_CALLBACK NativeCallback
{
get
{
return this.nativeCallback;
}
}
/// <summary>
/// Determine if the callback is wrapping the specified JET_CALLBACK.
/// </summary>
/// <param name="callback">The callback.</param>
/// <returns>True if this wrapper is wrapping the callback.</returns>
public bool IsWrapping(JET_CALLBACK callback)
{
return callback.Equals(this.wrappedCallback.Target);
}
/// <summary>
/// Callback function for native code. We don't want to throw an exception through
/// unmanaged ESENT because that will corrupt ESENT's internal state. Instead we
/// catch all exceptions and return an error instead. We use a CER to make catching
/// the exceptions as reliable as possible.
/// </summary>
/// <param name="nativeSesid">The session for which the callback is being made.</param>
/// <param name="nativeDbid">The database for which the callback is being made.</param>
/// <param name="nativeTableid">The cursor for which the callback is being made.</param>
/// <param name="nativeCbtyp">The operation for which the callback is being made.</param>
/// <param name="arg1">First callback-specific argument.</param>
/// <param name="arg2">Second callback-specific argument.</param>
/// <param name="nativeContext">Callback context.</param>
/// <param name="unused">This parameter is not used.</param>
/// <returns>An ESENT error code.</returns>
private JET_err CallbackImpl(
IntPtr nativeSesid,
uint nativeDbid,
IntPtr nativeTableid,
uint nativeCbtyp,
IntPtr arg1,
IntPtr arg2,
IntPtr nativeContext,
IntPtr unused)
{
RuntimeHelpers.PrepareConstrainedRegions();
try
{
var sesid = new JET_SESID { Value = nativeSesid };
var dbid = new JET_DBID { Value = nativeDbid };
var tableid = new JET_TABLEID { Value = nativeTableid };
JET_cbtyp cbtyp = (JET_cbtyp)nativeCbtyp;
Debug.Assert(this.wrappedCallback.IsAlive, "Wrapped callback has been garbage collected");
// This will throw an exception if the wrapped callback has been collected. The exception
// will be handled below.
JET_CALLBACK callback = (JET_CALLBACK)this.wrappedCallback.Target;
return callback(sesid, dbid, tableid, cbtyp, null, null, nativeContext, IntPtr.Zero);
}
catch (Exception ex)
{
// Thread aborts aren't handled here. ESENT callbacks can execute on client threads or
// internal ESENT threads so it isn't clear what should be done on an abort.
Trace.WriteLineIf(
TraceSwitch.TraceWarning,
string.Format(CultureInfo.InvariantCulture, "Caught Exception {0}", ex));
return JET_err.CallbackFailed;
}
}
}
}

View File

@ -0,0 +1,67 @@
//-----------------------------------------------------------------------
// <copyright file="JetCapabilities.cs" company="Microsoft Corporation">
// Copyright (c) Microsoft Corporation.
// </copyright>
//-----------------------------------------------------------------------
namespace Microsoft.Isam.Esent.Interop.Implementation
{
/// <summary>
/// Describes the functionality exposed by an object which implements IJetApi.
/// </summary>
internal sealed class JetCapabilities
{
/// <summary>
/// Gets or sets a value indicating whether Windows Server 2003 features
/// (in the Interop.Server2003 namespace) are supported.
/// </summary>
public bool SupportsServer2003Features { get; set; }
/// <summary>
/// Gets or sets a value indicating whether Vista features (in the
/// Interop.Vista namespace) are supported.
/// </summary>
public bool SupportsVistaFeatures { get; set; }
/// <summary>
/// Gets or sets a value indicating whether Win7 features (in the
/// Interop.Windows7 namespace) are supported.
/// </summary>
public bool SupportsWindows7Features { get; set; }
/// <summary>
/// Gets or sets a value indicating whether Win8 features (in the
/// Interop.Windows8 namespace) are supported.
/// </summary>
public bool SupportsWindows8Features { get; set; }
/// <summary>
/// Gets or sets a value indicating whether Win8.1 features (in the
/// Interop.Windows81 namespace) are supported.
/// </summary>
public bool SupportsWindows81Features { get; set; }
/// <summary>
/// Gets or sets a value indicating whether Win10 features (in the
/// Interop.Windows10 namespace) are supported.
/// </summary>
public bool SupportsWindows10Features { get; set; }
/// <summary>
/// Gets or sets a value indicating whether unicode file paths are supported.
/// </summary>
public bool SupportsUnicodePaths { get; set; }
/// <summary>
/// Gets or sets a value indicating whether large (> 255 byte) keys are supported.
/// The key size for an index can be specified in the <see cref="JET_INDEXCREATE"/>
/// object.
/// </summary>
public bool SupportsLargeKeys { get; set; }
/// <summary>
/// Gets or sets the maximum number of components in a sort or index key.
/// </summary>
public int ColumnsKeyMost { get; set; }
}
}

View File

@ -0,0 +1,191 @@
//-----------------------------------------------------------------------
// <copyright file="jet_indexcreate3.cs" company="Microsoft Corporation">
// Copyright (c) Microsoft Corporation.
// </copyright>
//-----------------------------------------------------------------------
namespace Microsoft.Isam.Esent.Interop
{
using System;
using System.Diagnostics.CodeAnalysis;
using System.Runtime.InteropServices;
using Microsoft.Isam.Esent.Interop.Vista;
/// <summary>
/// The native version of the JET_INDEXCREATE3 structure.
/// </summary>
[StructLayout(LayoutKind.Sequential)]
[SuppressMessage("Microsoft.StyleCop.CSharp.NamingRules",
"SA1305:FieldNamesMustNotUseHungarianNotation",
Justification = "This should match the unmanaged API, which isn't capitalized.")]
[SuppressMessage(
"Microsoft.StyleCop.CSharp.NamingRules",
"SA1307:AccessibleFieldsMustBeginWithUpperCaseLetter",
Justification = "This should match the unmanaged API, which isn't capitalized.")]
internal unsafe struct NATIVE_INDEXCREATE3
{
/// <summary>
/// Size of the structure.
/// </summary>
public uint cbStruct;
/// <summary>
/// Name of the index.
/// </summary>
public IntPtr szIndexName;
/// <summary>
/// Index key description.
/// </summary>
public IntPtr szKey;
/// <summary>
/// Size of index key description.
/// </summary>
public uint cbKey;
/// <summary>
/// Index options.
/// </summary>
public uint grbit;
/// <summary>
/// Index density.
/// </summary>
public uint ulDensity;
/// <summary>
/// Pointer to unicode sort options.
/// </summary>
public NATIVE_UNICODEINDEX2* pidxUnicode;
/// <summary>
/// Maximum size of column data to index. This can also be
/// a pointer to a JET_TUPLELIMITS structure.
/// </summary>
public IntPtr cbVarSegMac;
/// <summary>
/// Pointer to array of conditional columns.
/// </summary>
public IntPtr rgconditionalcolumn;
/// <summary>
/// Count of conditional columns.
/// </summary>
public uint cConditionalColumn;
/// <summary>
/// Returned error from index creation.
/// </summary>
public int err;
/// <summary>
/// Maximum size of the key.
/// </summary>
public uint cbKeyMost;
/// <summary>
/// A <see cref="NATIVE_SPACEHINTS"/> pointer.
/// </summary>
public IntPtr pSpaceHints;
}
/// <summary>
/// Contains the information needed to create an index over data in an ESE database.
/// </summary>
public sealed partial class JET_INDEXCREATE : IContentEquatable<JET_INDEXCREATE>, IDeepCloneable<JET_INDEXCREATE>
{
/// <summary>
/// Gets the native (interop) version of this object, except for
/// <see cref="szIndexName"/> and <see cref="szKey"/>.
/// </summary>
/// <remarks>The cbKey holds the length of the key in bytes, and does not need to be adjusted.</remarks>
/// <returns>The native (interop) version of this object.</returns>
internal NATIVE_INDEXCREATE3 GetNativeIndexcreate3()
{
this.CheckMembersAreValid();
var native = new NATIVE_INDEXCREATE3();
native.cbStruct = checked((uint)Marshal.SizeOf(typeof(NATIVE_INDEXCREATE3)));
// szIndexName and szKey are converted at pinvoke time.
//
// native.szIndexName = this.szIndexName;
// native.szKey = this.szKey;
native.cbKey = checked((uint)this.cbKey * sizeof(char));
native.grbit = unchecked((uint)this.grbit);
native.ulDensity = checked((uint)this.ulDensity);
native.cbVarSegMac = new IntPtr(this.cbVarSegMac);
native.cConditionalColumn = checked((uint)this.cConditionalColumn);
if (0 != this.cbKeyMost)
{
native.cbKeyMost = checked((uint)this.cbKeyMost);
native.grbit |= unchecked((uint)VistaGrbits.IndexKeyMost);
}
return native;
}
/// <summary>
/// Sets only the output fields of the object from a <see cref="NATIVE_INDEXCREATE3"/> struct,
/// specifically <see cref="err"/>.
/// </summary>
/// <param name="value">
/// The native indexcreate to set the values from.
/// </param>
internal void SetFromNativeIndexCreate(ref NATIVE_INDEXCREATE3 value)
{
this.err = (JET_err)value.err;
}
/// <summary>
/// Sets all of the fields (not just output fields) of the object from a <see cref="NATIVE_INDEXCREATE3"/> struct,
/// specifically <see cref="err"/>.
/// </summary>
/// <param name="value">
/// The native indexcreate to set the values from.
/// </param>
internal void SetAllFromNativeIndexCreate(ref NATIVE_INDEXCREATE3 value)
{
this.szIndexName = Marshal.PtrToStringUni(value.szIndexName);
this.cbKey = unchecked((int)value.cbKey / sizeof(char));
this.szKey = Marshal.PtrToStringUni(value.szKey, this.cbKey);
if (this.cbKey != this.szKey.Length)
{
throw new ArgumentException(string.Format("cbKey {0} != szKey.Length {1}", this.cbKey, this.szKey.Length));
}
this.grbit = unchecked((CreateIndexGrbit)value.grbit);
this.ulDensity = unchecked((int)value.ulDensity);
unsafe
{
this.pidxUnicode = new JET_UNICODEINDEX(ref *value.pidxUnicode);
}
this.cbVarSegMac = (int)value.cbVarSegMac;
this.cConditionalColumn = unchecked((int)value.cConditionalColumn);
this.rgconditionalcolumn = new JET_CONDITIONALCOLUMN[this.cConditionalColumn];
int sizeofConditionalColumn = Marshal.SizeOf(typeof(NATIVE_CONDITIONALCOLUMN));
for (int i = 0; i < this.cConditionalColumn; ++i)
{
IntPtr addressOfElement = value.rgconditionalcolumn + i * sizeofConditionalColumn;
NATIVE_CONDITIONALCOLUMN nativeConditionalColumn =
(NATIVE_CONDITIONALCOLUMN)Marshal.PtrToStructure(addressOfElement, typeof(NATIVE_CONDITIONALCOLUMN));
this.rgconditionalcolumn[i] = new JET_CONDITIONALCOLUMN(ref nativeConditionalColumn);
}
this.err = (JET_err)value.err;
this.cbKeyMost = unchecked((int)value.cbKeyMost);
var nativeSpaceHints = (NATIVE_SPACEHINTS)Marshal.PtrToStructure(value.pSpaceHints, typeof(NATIVE_SPACEHINTS));
this.pSpaceHints = new JET_SPACEHINTS();
this.pSpaceHints.SetFromNativeSpaceHints(nativeSpaceHints);
}
}
}

View File

@ -0,0 +1,97 @@
//-----------------------------------------------------------------------
// <copyright file="jet_opentemporarytable2.cs" company="Microsoft Corporation">
// Copyright (c) Microsoft Corporation.
// </copyright>
//-----------------------------------------------------------------------
namespace Microsoft.Isam.Esent.Interop.Vista
{
using System;
using System.Diagnostics.CodeAnalysis;
using System.Globalization;
using System.Runtime.InteropServices;
/// <summary>
/// The native version of the JET_OPENTEMPORARYTABLE2 structure.
/// </summary>
[StructLayout(LayoutKind.Sequential)]
[SuppressMessage("Microsoft.StyleCop.CSharp.NamingRules",
"SA1305:FieldNamesMustNotUseHungarianNotation",
Justification = "This should match the unmanaged API, which isn't capitalized.")]
[SuppressMessage(
"Microsoft.StyleCop.CSharp.NamingRules",
"SA1307:AccessibleFieldsMustBeginWithUpperCaseLetter",
Justification = "This should match the unmanaged API, which isn't capitalized.")]
internal unsafe struct NATIVE_OPENTEMPORARYTABLE2
{
/// <summary>
/// Size of the structure.
/// </summary>
public uint cbStruct;
/// <summary>
/// Columns to create.
/// </summary>
public NATIVE_COLUMNDEF* prgcolumndef;
/// <summary>
/// Number of entries in prgcolumndef.
/// </summary>
public uint ccolumn;
/// <summary>
/// Optional pointer to unicode index information.
/// </summary>
public NATIVE_UNICODEINDEX2* pidxunicode;
/// <summary>
/// Table options.
/// </summary>
public uint grbit;
/// <summary>
/// Pointer to array of returned columnids. This
/// should have at least ccolumn entries.
/// </summary>
public uint* rgcolumnid;
/// <summary>
/// Maximum key size.
/// </summary>
public uint cbKeyMost;
/// <summary>
/// Maximum amount of data used to construct a key.
/// </summary>
public uint cbVarSegMac;
/// <summary>
/// Returns the tableid of the new table.
/// </summary>
public IntPtr tableid;
}
/// <summary>
/// A collection of parameters for the JetOpenTemporaryTable method.
/// </summary>
public partial class JET_OPENTEMPORARYTABLE
{
/// <summary>
/// Returns the unmanaged opentemporarytable that represents this managed class.
/// </summary>
/// <returns>
/// A native (interop) version of the JET_OPENTEMPORARYTABLE.
/// </returns>
internal NATIVE_OPENTEMPORARYTABLE2 GetNativeOpenTemporaryTable2()
{
this.CheckDataSize();
var openTemporaryTable = new NATIVE_OPENTEMPORARYTABLE2();
openTemporaryTable.cbStruct = checked((uint)Marshal.SizeOf(typeof(NATIVE_OPENTEMPORARYTABLE2)));
openTemporaryTable.ccolumn = checked((uint)this.ccolumn);
openTemporaryTable.grbit = (uint)this.grbit;
openTemporaryTable.cbKeyMost = checked((uint)this.cbKeyMost);
openTemporaryTable.cbVarSegMac = checked((uint)this.cbVarSegMac);
return openTemporaryTable;
}
}
}

View File

@ -0,0 +1,159 @@
//-----------------------------------------------------------------------
// <copyright file="jet_tablecreate4.cs" company="Microsoft Corporation">
// Copyright (c) Microsoft Corporation.
// </copyright>
//-----------------------------------------------------------------------
namespace Microsoft.Isam.Esent.Interop
{
using System;
using System.Diagnostics;
using System.Diagnostics.CodeAnalysis;
using System.Globalization;
using System.Runtime.InteropServices;
using Microsoft.Isam.Esent.Interop.Implementation;
/// <summary>
/// The native version of the <see cref="JET_TABLECREATE"/> structure. This includes callbacks,
/// space hints, and uses NATIVE_INDEXCREATE4.
/// </summary>
[StructLayout(LayoutKind.Sequential)]
[SuppressMessage("Microsoft.StyleCop.CSharp.NamingRules",
"SA1305:FieldNamesMustNotUseHungarianNotation",
Justification = "This should match the unmanaged API, which isn't capitalized.")]
[SuppressMessage(
"Microsoft.StyleCop.CSharp.NamingRules",
"SA1307:AccessibleFieldsMustBeginWithUpperCaseLetter",
Justification = "This should match the unmanaged API, which isn't capitalized.")]
internal unsafe struct NATIVE_TABLECREATE4
{
/// <summary>
/// Size of the structure.
/// </summary>
public uint cbStruct;
/// <summary>
/// Name of the table to create.
/// </summary>
[MarshalAs(UnmanagedType.LPWStr)]
public string szTableName;
/// <summary>
/// Name of the table from which to inherit base DDL.
/// </summary>
[MarshalAs(UnmanagedType.LPWStr)]
public string szTemplateTableName;
/// <summary>
/// Initial pages to allocate for table.
/// </summary>
public uint ulPages;
/// <summary>
/// Table density.
/// </summary>
public uint ulDensity;
/// <summary>
/// Array of column creation info.
/// </summary>
public NATIVE_COLUMNCREATE* rgcolumncreate;
/// <summary>
/// Number of columns to create.
/// </summary>
public uint cColumns;
/// <summary>
/// Array of indices to create, pointer to <see cref="NATIVE_INDEXCREATE3"/>.
/// </summary>
public IntPtr rgindexcreate;
/// <summary>
/// Number of indices to create.
/// </summary>
public uint cIndexes;
/// <summary>
/// Callback function to use for the table.
/// </summary>
[MarshalAs(UnmanagedType.LPWStr)]
public string szCallback;
/// <summary>
/// Type of the callback function.
/// </summary>
public JET_cbtyp cbtyp;
/// <summary>
/// Table options.
/// </summary>
public uint grbit;
/// <summary>
/// Space allocation, maintenance, and usage hints for default sequential index.
/// </summary>
public NATIVE_SPACEHINTS* pSeqSpacehints;
/// <summary>
/// Space allocation, maintenance, and usage hints for Separated LV tree.
/// </summary>
public NATIVE_SPACEHINTS* pLVSpacehints;
/// <summary>
/// Heuristic size to separate a intrinsic LV from the primary record.
/// </summary>
public uint cbSeparateLV;
/// <summary>
/// Returned tableid.
/// </summary>
public IntPtr tableid;
/// <summary>
/// Count of objects created (columns+table+indexes+callbacks).
/// </summary>
public uint cCreated;
}
/// <summary>
/// Contains the information needed to create a table in an ESE database.
/// </summary>
public partial class JET_TABLECREATE : IContentEquatable<JET_TABLECREATE>, IDeepCloneable<JET_TABLECREATE>
{
/// <summary>
/// Gets the native (interop) version of this object. The following members are
/// NOT converted: <see cref="rgcolumncreate"/>, <see cref="rgindexcreate"/>,
/// <see cref="pSeqSpacehints"/>, and <see cref="pLVSpacehints"/>.
/// </summary>
/// <returns>The native (interop) version of this object.</returns>
internal NATIVE_TABLECREATE4 GetNativeTableCreate4()
{
this.CheckMembersAreValid();
var native = new NATIVE_TABLECREATE4();
native.cbStruct = checked((uint)Marshal.SizeOf(typeof(NATIVE_TABLECREATE4)));
native.szTableName = this.szTableName;
native.szTemplateTableName = this.szTemplateTableName;
native.ulPages = checked((uint)this.ulPages);
native.ulDensity = checked((uint)this.ulDensity);
// native.rgcolumncreate is done at pinvoke time.
native.cColumns = checked((uint)this.cColumns);
// native.rgindexcreate is done at pinvoke time.
native.cIndexes = checked((uint)this.cIndexes);
native.szCallback = this.szCallback;
native.cbtyp = this.cbtyp;
native.grbit = checked((uint)this.grbit);
// native.pSeqSpacehints is done at pinvoke time.
// native.pLVSpacehints is done at pinvoke time.
native.cbSeparateLV = checked((uint)this.cbSeparateLV);
native.tableid = this.tableid.Value;
native.cCreated = checked((uint)this.cCreated);
return native;
}
}
}

View File

@ -0,0 +1,26 @@
//-----------------------------------------------------------------------
// <copyright file="LegacyFileNames.cs" company="Microsoft Corporation">
// Copyright (c) Microsoft Corporation.
// </copyright>
//-----------------------------------------------------------------------
namespace Microsoft.Isam.Esent.Interop.Vista
{
/// <summary>
/// Options for LegacyFileNames.
/// </summary>
public enum LegacyFileNames
{
/// <summary>
/// When this option is present then the database engine will use the following naming conventions for its files:
/// o Transaction Log files will use .LOG for their file extension.
/// o Checkpoint files will use .CHK for their file extension.
/// </summary>
ESE98FileNames = 0x00000001,
/// <summary>
/// Preserve the 8.3 naming syntax for as long as possible. (this should not be changed, w/o ensuring there are no log files).
/// </summary>
EightDotThreeSoftCompat = 0x00000002,
}
}

View File

@ -0,0 +1,273 @@
//-----------------------------------------------------------------------
// <copyright file="LibraryHelpers.cs" company="Microsoft Corporation">
// Copyright (c) Microsoft Corporation.
// </copyright>
//-----------------------------------------------------------------------
namespace Microsoft.Isam.Esent.Interop
{
using System;
using System.Globalization;
using System.Runtime.InteropServices;
using System.Security;
using System.Text;
using System.Threading;
using Microsoft.Isam.Esent.Interop.Implementation;
/// <summary>
/// Contains several helper functions that are useful in the test binary.
/// In particular, it contains functionality that is not available in
/// reduced-functionality environments (such as CoreClr).
/// </summary>
internal static class LibraryHelpers
{
/// <summary>Provides a platform-specific character used to separate directory levels in a path string that reflects a hierarchical file system organization.</summary>
/// <filterpriority>1</filterpriority>
public static readonly char DirectorySeparatorChar = '\\';
/// <summary>Provides a platform-specific alternate character used to separate directory levels in a path string that reflects a hierarchical file system organization.</summary>
/// <filterpriority>1</filterpriority>
public static readonly char AltDirectorySeparatorChar = '/';
/// <summary>
/// Gets an ASCII encoder.
/// </summary>
public static Encoding EncodingASCII
{
get
{
#if MANAGEDESENT_ON_CORECLR
return SlowAsciiEncoding.Encoding;
#else
return Encoding.ASCII;
#endif
}
}
/// <summary>
/// Gets a new ASCII encoder. It's preferred to use EncodingASCII, but some applications (e.g. tests)
/// may want a different Encoding object.
/// </summary>
public static Encoding NewEncodingASCII
{
get
{
#if MANAGEDESENT_ON_CORECLR
return new SlowAsciiEncoding();
#else
return new ASCIIEncoding();
#endif
}
}
// This should be dead code when running on Core CLR; This is only called by
// GetIndexInfoFromIndexlist() when called on a pre-Win8 system, and Core CLR
// is only on Win8 anyway.
#if !MANAGEDESENT_ON_CORECLR
/// <summary>
/// Creates a CultureInfo object when given the LCID.
/// </summary>
/// <param name="lcid">
/// The lcid passed in.
/// </param>
/// <returns>
/// A CultureInfo object.
/// </returns>
public static CultureInfo CreateCultureInfoByLcid(int lcid)
{
return new CultureInfo(lcid);
}
#endif // !MANAGEDESENT_ON_CORECLR
/// <summary>
/// Allocates memory on the native heap.
/// </summary>
/// <returns>A pointer to native memory.</returns>
/// <param name="size">The size of the memory desired.</param>
public static IntPtr MarshalAllocHGlobal(int size)
{
#if MANAGEDESENT_ON_CORECLR && !MANAGEDESENT_ON_WSA
return Win32.NativeMethods.LocalAlloc(0, new UIntPtr((uint)size));
#else
return Marshal.AllocHGlobal(size);
#endif
}
/// <summary>
/// Frees memory that was allocated on the native heap.
/// </summary>
/// <param name="buffer">A pointer to native memory.</param>
public static void MarshalFreeHGlobal(IntPtr buffer)
{
#if MANAGEDESENT_ON_CORECLR && !MANAGEDESENT_ON_WSA
Win32.NativeMethods.LocalFree(buffer);
#else
Marshal.FreeHGlobal(buffer);
#endif
}
/// <summary>Copies the contents of a managed <see cref="T:System.String" /> into unmanaged memory.</summary>
/// <returns>The address, in unmanaged memory, to where the <paramref name="managedString" /> was copied, or 0 if <paramref name="managedString" /> is null.</returns>
/// <param name="managedString">A managed string to be copied.</param>
/// <exception cref="T:System.OutOfMemoryException">The method could not allocate enough native heap memory.</exception>
/// <exception cref="T:System.ArgumentOutOfRangeException">The <paramref name="managedString" /> parameter exceeds the maximum length allowed by the operating system.</exception>
public static IntPtr MarshalStringToHGlobalUni(string managedString)
{
#if MANAGEDESENT_ON_CORECLR && !MANAGEDESENT_ON_WSA
return MyStringToHGlobalUni(managedString);
#else
return Marshal.StringToHGlobalUni(managedString);
#endif
}
/// <summary>
/// Retrieves the managed ID of the current thread.
/// </summary>
/// <returns>The ID of the current thread.</returns>
public static int GetCurrentManagedThreadId()
{
#if MANAGEDESENT_ON_CORECLR
return Environment.CurrentManagedThreadId;
#else
return Thread.CurrentThread.ManagedThreadId;
#endif
}
/// <summary>
/// Cancels an <see cref="M:System.Threading.Thread.Abort(System.Object)"/> requested for the current thread.
/// </summary>
/// <exception cref="T:System.Threading.ThreadStateException">Abort was not invoked on the current thread. </exception><exception cref="T:System.Security.SecurityException">The caller does not have the required security permission for the current thread. </exception><filterpriority>2</filterpriority><PermissionSet><IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="ControlThread"/></PermissionSet>
public static void ThreadResetAbort()
{
#if MANAGEDESENT_ON_CORECLR
// Do nothing.
#else
Thread.ResetAbort();
#endif
}
// FUTURE-2013/12/16-martinc. It appears that all of this hacking for running on Core CLR may no longer be necessary.
// We initially ported to an early version of Core CLR that had a lot of functionality missing. By the time
// Windows Store Apps came out in Windows 8, many of these functions were added back.
#if MANAGEDESENT_ON_CORECLR && !MANAGEDESENT_ON_WSA
// System.Runtime.InteropServices.Marshal
/// <summary>Copies the contents of a managed <see cref="T:System.String" /> into unmanaged memory.</summary>
/// <returns>The address, in unmanaged memory, to where the <paramref name="managedString" /> was copied, or 0 if <paramref name="managedString" /> is null.</returns>
/// <param name="managedString">A managed string to be copied.</param>
/// <exception cref="T:System.OutOfMemoryException">The method could not allocate enough native heap memory.</exception>
/// <exception cref="T:System.ArgumentOutOfRangeException">The <paramref name="managedString" /> parameter exceeds the maximum length allowed by the operating system.</exception>
[SecurityCritical]
private static unsafe IntPtr MyStringToHGlobalUni(string managedString)
{
if (managedString == null)
{
return IntPtr.Zero;
}
int charCountWithNull = managedString.Length + 1;
int byteCount = charCountWithNull * sizeof(char);
if (byteCount < managedString.Length)
{
throw new ArgumentOutOfRangeException("managedString");
}
UIntPtr sizetdwBytes = new UIntPtr((uint)byteCount);
IntPtr rawBuffer = Win32.NativeMethods.LocalAlloc(0, sizetdwBytes);
if (rawBuffer == IntPtr.Zero)
{
throw new OutOfMemoryException();
}
fixed (char* sourcePointer = managedString)
{
byte* destPointer = (byte*)rawBuffer;
var unicodeEncoding = new System.Text.UnicodeEncoding();
int bytesWritten = unicodeEncoding.GetBytes(sourcePointer, charCountWithNull, destPointer, byteCount);
}
return rawBuffer;
}
#endif // MANAGEDESENT_ON_CORECLR && !MANAGEDESENT_ON_WSA
/// <summary>Returns a <see cref="T:System.DateTime" /> equivalent to the specified OLE Automation Date.</summary>
/// <returns>A <see cref="T:System.DateTime" /> that represents the same date and time as <paramref name="d" />.</returns>
/// <param name="d">An OLE Automation Date value. </param>
/// <exception cref="T:System.ArgumentException">The date is not a valid OLE Automation Date value. </exception>
/// <filterpriority>1</filterpriority>
public static DateTime FromOADate(double d)
{
#if MANAGEDESENT_ON_CORECLR
return new DateTime(DoubleDateToTicks(d), DateTimeKind.Unspecified);
#else
return DateTime.FromOADate(d);
#endif
}
#if MANAGEDESENT_ON_CORECLR
/// <summary>
/// Copied from the reflected implementation.
/// </summary>
/// <param name="value">The date, as a 64bit integer.</param>
/// <returns>The date, as a double representation.</returns>
internal static double TicksToOADate(long value)
{
if (value == 0L)
{
return 0.0;
}
if (value < 864000000000L)
{
value += 599264352000000000L;
}
if (value < 31241376000000000L)
{
throw new OverflowException();
}
long num = (value - 599264352000000000L) / 10000L;
if (num < 0L)
{
long num2 = num % 86400000L;
if (num2 != 0L)
{
num -= (86400000L + num2) * 2L;
}
}
return (double)num / 86400000.0;
}
/// <summary>
/// Copied from the reflected implementation.
/// </summary>
/// <param name="value">The date, as a double representation.</param>
/// <returns>The date, as a 64bit integer.</returns>
internal static long DoubleDateToTicks(double value)
{
if (value >= 2958466.0 || value <= -657435.0)
{
throw new ArgumentException("value does not represent a valid date", "value");
}
long num = (long)((value * 86400000.0) + ((value >= 0.0) ? 0.5 : -0.5));
if (num < 0L)
{
num -= (num % 86400000L) * 2L;
}
num += 59926435200000L;
if (num < 0L || num >= 315537897600000L)
{
throw new ArgumentException("value does not represent a valid date", "value");
}
return num * 10000L;
}
#endif
}
}

View File

@ -0,0 +1,321 @@
//-----------------------------------------------------------------------
// <copyright file="MakeKeyHelpers.cs" company="Microsoft Corporation">
// Copyright (c) Microsoft Corporation.
// </copyright>
//-----------------------------------------------------------------------
namespace Microsoft.Isam.Esent.Interop
{
using System;
using System.Text;
/// <summary>
/// Helper methods for the ESENT API. These do data conversion for
/// JetMakeKey.
/// </summary>
public static partial class Api
{
/// <summary>
/// Constructs a search key that may then be used by <see cref="JetSeek"/>
/// and <see cref="JetSetIndexRange"/>.
/// </summary>
/// <param name="sesid">The session to use.</param>
/// <param name="tableid">The cursor to create the key on.</param>
/// <param name="data">Column data for the current key column of the current index.</param>
/// <param name="grbit">Key options.</param>
public static void MakeKey(JET_SESID sesid, JET_TABLEID tableid, byte[] data, MakeKeyGrbit grbit)
{
if (null == data)
{
Api.JetMakeKey(sesid, tableid, null, 0, grbit);
}
else if (0 == data.Length)
{
Api.JetMakeKey(sesid, tableid, data, data.Length, grbit | MakeKeyGrbit.KeyDataZeroLength);
}
else
{
Api.JetMakeKey(sesid, tableid, data, data.Length, grbit);
}
}
/// <summary>
/// Constructs a search key that may then be used by <see cref="JetSeek"/>
/// and <see cref="JetSetIndexRange"/>.
/// </summary>
/// <param name="sesid">The session to use.</param>
/// <param name="tableid">The cursor to create the key on.</param>
/// <param name="data">Column data for the current key column of the current index.</param>
/// <param name="encoding">The encoding used to convert the string.</param>
/// <param name="grbit">Key options.</param>
public static void MakeKey(JET_SESID sesid, JET_TABLEID tableid, string data, Encoding encoding, MakeKeyGrbit grbit)
{
CheckEncodingIsValid(encoding);
if (null == data)
{
Api.JetMakeKey(sesid, tableid, null, 0, grbit);
}
else if (0 == data.Length)
{
Api.JetMakeKey(sesid, tableid, null, 0, grbit | MakeKeyGrbit.KeyDataZeroLength);
}
else if (Encoding.Unicode == encoding)
{
// Optimization for Unicode strings
unsafe
{
fixed (char* buffer = data)
{
Api.JetMakeKey(sesid, tableid, new IntPtr(buffer), checked(data.Length * sizeof(char)), grbit);
}
}
}
else
{
#if MANAGEDESENT_ON_WSA
// Encoding.GetBytes(char*, int, byte*, int) overload is missing in new Windows UI.
// So we can't use the ColumnCache. We'll just use a different GetBytes() overload.
byte[] buffer = encoding.GetBytes(data);
Api.JetMakeKey(sesid, tableid, buffer, buffer.Length, grbit);
#else
// Convert the string using a cached column buffer. The column buffer is far larger
// than the maximum key size, so any data truncation here won't matter.
byte[] buffer = null;
try
{
buffer = Caches.ColumnCache.Allocate();
int dataSize;
unsafe
{
fixed (char* chars = data)
fixed (byte* bytes = buffer)
{
dataSize = encoding.GetBytes(chars, data.Length, bytes, buffer.Length);
}
}
JetMakeKey(sesid, tableid, buffer, dataSize, grbit);
}
finally
{
if (buffer != null)
{
Caches.ColumnCache.Free(ref buffer);
}
}
#endif
}
}
/// <summary>
/// Constructs a search key that may then be used by <see cref="JetSeek"/>
/// and <see cref="JetSetIndexRange"/>.
/// </summary>
/// <param name="sesid">The session to use.</param>
/// <param name="tableid">The cursor to create the key on.</param>
/// <param name="data">Column data for the current key column of the current index.</param>
/// <param name="grbit">Key options.</param>
public static void MakeKey(JET_SESID sesid, JET_TABLEID tableid, bool data, MakeKeyGrbit grbit)
{
byte b = data ? (byte)0xff : (byte)0x0;
Api.MakeKey(sesid, tableid, b, grbit);
}
/// <summary>
/// Constructs a search key that may then be used by <see cref="JetSeek"/>
/// and <see cref="JetSetIndexRange"/>.
/// </summary>
/// <param name="sesid">The session to use.</param>
/// <param name="tableid">The cursor to create the key on.</param>
/// <param name="data">Column data for the current key column of the current index.</param>
/// <param name="grbit">Key options.</param>
public static void MakeKey(JET_SESID sesid, JET_TABLEID tableid, byte data, MakeKeyGrbit grbit)
{
unsafe
{
const int DataSize = sizeof(byte);
var pointer = new IntPtr(&data);
Api.JetMakeKey(sesid, tableid, pointer, DataSize, grbit);
}
}
/// <summary>
/// Constructs a search key that may then be used by <see cref="JetSeek"/>
/// and <see cref="JetSetIndexRange"/>.
/// </summary>
/// <param name="sesid">The session to use.</param>
/// <param name="tableid">The cursor to create the key on.</param>
/// <param name="data">Column data for the current key column of the current index.</param>
/// <param name="grbit">Key options.</param>
public static void MakeKey(JET_SESID sesid, JET_TABLEID tableid, short data, MakeKeyGrbit grbit)
{
unsafe
{
const int DataSize = sizeof(short);
var pointer = new IntPtr(&data);
Api.JetMakeKey(sesid, tableid, pointer, DataSize, grbit);
}
}
/// <summary>
/// Constructs a search key that may then be used by <see cref="JetSeek"/>
/// and <see cref="JetSetIndexRange"/>.
/// </summary>
/// <param name="sesid">The session to use.</param>
/// <param name="tableid">The cursor to create the key on.</param>
/// <param name="data">Column data for the current key column of the current index.</param>
/// <param name="grbit">Key options.</param>
public static void MakeKey(JET_SESID sesid, JET_TABLEID tableid, int data, MakeKeyGrbit grbit)
{
unsafe
{
const int DataSize = sizeof(int);
var pointer = new IntPtr(&data);
Api.JetMakeKey(sesid, tableid, pointer, DataSize, grbit);
}
}
/// <summary>
/// Constructs a search key that may then be used by <see cref="JetSeek"/>
/// and <see cref="JetSetIndexRange"/>.
/// </summary>
/// <param name="sesid">The session to use.</param>
/// <param name="tableid">The cursor to create the key on.</param>
/// <param name="data">Column data for the current key column of the current index.</param>
/// <param name="grbit">Key options.</param>
public static void MakeKey(JET_SESID sesid, JET_TABLEID tableid, long data, MakeKeyGrbit grbit)
{
unsafe
{
const int DataSize = sizeof(long);
var pointer = new IntPtr(&data);
Api.JetMakeKey(sesid, tableid, pointer, DataSize, grbit);
}
}
/// <summary>
/// Constructs a search key that may then be used by <see cref="JetSeek"/>
/// and <see cref="JetSetIndexRange"/>.
/// </summary>
/// <param name="sesid">The session to use.</param>
/// <param name="tableid">The cursor to create the key on.</param>
/// <param name="data">Column data for the current key column of the current index.</param>
/// <param name="grbit">Key options.</param>
public static void MakeKey(JET_SESID sesid, JET_TABLEID tableid, Guid data, MakeKeyGrbit grbit)
{
unsafe
{
const int DataSize = 16 /* sizeof(Guid) */;
var pointer = new IntPtr(&data);
Api.JetMakeKey(sesid, tableid, pointer, DataSize, grbit);
}
}
/// <summary>
/// Constructs a search key that may then be used by <see cref="JetSeek"/>
/// and <see cref="JetSetIndexRange"/>.
/// </summary>
/// <param name="sesid">The session to use.</param>
/// <param name="tableid">The cursor to create the key on.</param>
/// <param name="data">Column data for the current key column of the current index.</param>
/// <param name="grbit">Key options.</param>
public static void MakeKey(JET_SESID sesid, JET_TABLEID tableid, DateTime data, MakeKeyGrbit grbit)
{
Api.MakeKey(sesid, tableid, data.ToOADate(), grbit);
}
/// <summary>
/// Constructs a search key that may then be used by <see cref="JetSeek"/>
/// and <see cref="JetSetIndexRange"/>.
/// </summary>
/// <param name="sesid">The session to use.</param>
/// <param name="tableid">The cursor to create the key on.</param>
/// <param name="data">Column data for the current key column of the current index.</param>
/// <param name="grbit">Key options.</param>
public static void MakeKey(JET_SESID sesid, JET_TABLEID tableid, float data, MakeKeyGrbit grbit)
{
unsafe
{
const int DataSize = sizeof(float);
var pointer = new IntPtr(&data);
Api.JetMakeKey(sesid, tableid, pointer, DataSize, grbit);
}
}
/// <summary>
/// Constructs a search key that may then be used by <see cref="JetSeek"/>
/// and <see cref="JetSetIndexRange"/>.
/// </summary>
/// <param name="sesid">The session to use.</param>
/// <param name="tableid">The cursor to create the key on.</param>
/// <param name="data">Column data for the current key column of the current index.</param>
/// <param name="grbit">Key options.</param>
public static void MakeKey(JET_SESID sesid, JET_TABLEID tableid, double data, MakeKeyGrbit grbit)
{
unsafe
{
const int DataSize = sizeof(double);
var pointer = new IntPtr(&data);
Api.JetMakeKey(sesid, tableid, pointer, DataSize, grbit);
}
}
/// <summary>
/// Constructs a search key that may then be used by <see cref="JetSeek"/>
/// and <see cref="JetSetIndexRange"/>.
/// </summary>
/// <param name="sesid">The session to use.</param>
/// <param name="tableid">The cursor to create the key on.</param>
/// <param name="data">Column data for the current key column of the current index.</param>
/// <param name="grbit">Key options.</param>
[CLSCompliant(false)]
public static void MakeKey(JET_SESID sesid, JET_TABLEID tableid, ushort data, MakeKeyGrbit grbit)
{
unsafe
{
const int DataSize = sizeof(ushort);
var pointer = new IntPtr(&data);
Api.JetMakeKey(sesid, tableid, pointer, DataSize, grbit);
}
}
/// <summary>
/// Constructs a search key that may then be used by <see cref="JetSeek"/>
/// and <see cref="JetSetIndexRange"/>.
/// </summary>
/// <param name="sesid">The session to use.</param>
/// <param name="tableid">The cursor to create the key on.</param>
/// <param name="data">Column data for the current key column of the current index.</param>
/// <param name="grbit">Key options.</param>
[CLSCompliant(false)]
public static void MakeKey(JET_SESID sesid, JET_TABLEID tableid, uint data, MakeKeyGrbit grbit)
{
unsafe
{
const int DataSize = sizeof(uint);
var pointer = new IntPtr(&data);
Api.JetMakeKey(sesid, tableid, pointer, DataSize, grbit);
}
}
/// <summary>
/// Constructs a search key that may then be used by <see cref="JetSeek"/>
/// and <see cref="JetSetIndexRange"/>.
/// </summary>
/// <param name="sesid">The session to use.</param>
/// <param name="tableid">The cursor to create the key on.</param>
/// <param name="data">Column data for the current key column of the current index.</param>
/// <param name="grbit">Key options.</param>
[CLSCompliant(false)]
public static void MakeKey(JET_SESID sesid, JET_TABLEID tableid, ulong data, MakeKeyGrbit grbit)
{
unsafe
{
const int DataSize = sizeof(ulong);
var pointer = new IntPtr(&data);
Api.JetMakeKey(sesid, tableid, pointer, DataSize, grbit);
}
}
}
}

View File

@ -0,0 +1,151 @@
//-----------------------------------------------------------------------
// <copyright file="MemoryCache.cs" company="Microsoft Corporation">
// Copyright (c) Microsoft Corporation.
// </copyright>
//-----------------------------------------------------------------------
namespace Microsoft.Isam.Esent.Interop
{
using System;
using System.Diagnostics;
using System.Threading;
/// <summary>
/// Cache allocated chunks of memory that are needed for very short periods
/// of time. The memory is not zeroed on allocation.
/// </summary>
internal sealed class MemoryCache
{
/// <summary>
/// A zero-length array that should be used whenever we want to return one.
/// </summary>
private static readonly byte[] ZeroLengthArray = new byte[0];
/// <summary>
/// Default size for newly allocated buffers.
/// </summary>
private readonly int bufferSize;
/// <summary>
/// Currently cached buffers.
/// </summary>
private readonly byte[][] cachedBuffers;
/// <summary>
/// Initializes a new instance of the <see cref="MemoryCache"/> class.
/// </summary>
/// <param name="bufferSize">
/// The size of the buffers to cache.
/// </param>
/// <param name="maxCachedBuffers">
/// The maximum number of buffers to cache.
/// </param>
public MemoryCache(int bufferSize, int maxCachedBuffers)
{
this.bufferSize = bufferSize;
this.cachedBuffers = new byte[maxCachedBuffers][];
}
/// <summary>
/// Gets the size of the buffers that this cache returns.
/// </summary>
public int BufferSize
{
get
{
return this.bufferSize;
}
}
/// <summary>
/// Creates a new array containing a copy of 'length' bytes of data.
/// </summary>
/// <param name="data">The data to copy.</param>
/// <param name="length">The length of data to copy.</param>
/// <returns>An array containing the first length bytes of data.</returns>
public static byte[] Duplicate(byte[] data, int length)
{
Debug.Assert(data.Length >= length, "length parameter is too long");
if (0 == length)
{
return ZeroLengthArray;
}
var output = new byte[length];
Buffer.BlockCopy(data, 0, output, 0, length);
return output;
}
/// <summary>
/// Allocates a chunk of memory. If memory is cached it is returned. If no memory
/// is cached then it is allocated. Check the size of the returned buffer to determine
/// how much memory was allocated.
/// </summary>
/// <returns>A new memory buffer.</returns>
public byte[] Allocate()
{
int offset = this.GetStartingOffset();
for (int i = 0; i < this.cachedBuffers.Length; ++i)
{
int index = (i + offset) % this.cachedBuffers.Length;
byte[] buffer = Interlocked.Exchange(ref this.cachedBuffers[index], null);
if (null != buffer)
{
return buffer;
}
}
return new byte[this.bufferSize];
}
/// <summary>
/// Frees an unused buffer. This may be added to the cache.
/// </summary>
/// <param name="data">The memory to free.</param>
public void Free(ref byte[] data)
{
if (null == data)
{
throw new ArgumentNullException("data");
}
if (data.Length != this.bufferSize)
{
throw new ArgumentOutOfRangeException("data", data.Length, "buffer is not correct size for this MemoryCache");
}
int offset = this.GetStartingOffset();
// The buffers are garbage collected so we don't need to make Free()
// completely safe. In a multi-threaded situation we may see a null
// slot and then overwrite a buffer which was just freed into the slot.
// That will cause us to lose a buffer which could have been placed
// in a different slot, but in return we can do the Free() without
// expensive interlocked operations.
for (int i = 0; i < this.cachedBuffers.Length; ++i)
{
int index = (i + offset) % this.cachedBuffers.Length;
if (null == this.cachedBuffers[index])
{
this.cachedBuffers[index] = data;
break;
}
}
data = null;
}
/// <summary>
/// Get the offset in the cached buffers array to start allocating or freeing
/// buffers to. This is done so that all threads don't start operating on
/// slot zero, which would increase contention.
/// </summary>
/// <returns>The starting offset for Allocate/Free operations.</returns>
private int GetStartingOffset()
{
// Using the current CPU number would be ideal, but there doesn't seem to
// be a cheap way to get that information in managed code.
return LibraryHelpers.GetCurrentManagedThreadId() % this.cachedBuffers.Length;
}
}
}

View File

@ -0,0 +1,294 @@
//-----------------------------------------------------------------------
// <copyright file="MetaDataHelpers.cs" company="Microsoft Corporation">
// Copyright (c) Microsoft Corporation.
// </copyright>
//-----------------------------------------------------------------------
namespace Microsoft.Isam.Esent.Interop
{
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Text;
using Microsoft.Isam.Esent.Interop.Implementation;
/// <summary>
/// Helper methods for the ESENT API. These methods deal with database
/// meta-data.
/// </summary>
public static partial class Api
{
#region Simpler API. Overloads that omit unused/obsolete parameters.
/// <summary>
/// Initialize a new ESENT session.
/// </summary>
/// <param name="instance">The initialized instance to create the session in.</param>
/// <param name="sesid">Returns the created session.</param>
public static void BeginSession(JET_INSTANCE instance, out JET_SESID sesid)
{
Api.JetBeginSession(instance, out sesid, null, null);
}
/// <summary>
/// Creates and attaches a database file.
/// </summary>
/// <param name="sesid">The session to use.</param>
/// <param name="database">The path to the database file to create.</param>
/// <param name="dbid">Returns the dbid of the new database.</param>
/// <param name="grbit">Database creation options.</param>
public static void CreateDatabase(JET_SESID sesid, string database, out JET_DBID dbid, CreateDatabaseGrbit grbit)
{
Api.JetCreateDatabase(sesid, database, null, out dbid, grbit);
}
/// <summary>
/// Opens a database previously attached with <see cref="JetAttachDatabase"/>,
/// for use with a database session. This function can be called multiple times
/// for the same database.
/// </summary>
/// <param name="sesid">The session that is opening the database.</param>
/// <param name="database">The database to open.</param>
/// <param name="dbid">Returns the dbid of the attached database.</param>
/// <param name="grbit">Open database options.</param>
/// <returns>An ESENT warning code.</returns>
public static JET_wrn OpenDatabase(
JET_SESID sesid,
string database,
out JET_DBID dbid,
OpenDatabaseGrbit grbit)
{
return Api.JetOpenDatabase(sesid, database, null, out dbid, grbit);
}
/// <summary>
/// Opens a cursor on a previously created table.
/// </summary>
/// <param name="sesid">The database session to use.</param>
/// <param name="dbid">The database to open the table in.</param>
/// <param name="tablename">The name of the table to open.</param>
/// <param name="grbit">Table open options.</param>
/// <param name="tableid">Returns the opened table.</param>
/// <returns>An ESENT warning.</returns>
public static JET_wrn OpenTable(
JET_SESID sesid,
JET_DBID dbid,
string tablename,
OpenTableGrbit grbit,
out JET_TABLEID tableid)
{
return Api.JetOpenTable(sesid, dbid, tablename, null, 0, grbit, out tableid);
}
#endregion
/// <summary>
/// Try to open a table.
/// </summary>
/// <param name="sesid">The session to use.</param>
/// <param name="dbid">The database to look for the table in.</param>
/// <param name="tablename">The name of the table.</param>
/// <param name="grbit">Table open options.</param>
/// <param name="tableid">Returns the opened tableid.</param>
/// <returns>True if the table was opened, false if the table doesn't exist.</returns>
public static bool TryOpenTable(
JET_SESID sesid,
JET_DBID dbid,
string tablename,
OpenTableGrbit grbit,
out JET_TABLEID tableid)
{
var err = (JET_err)Impl.JetOpenTable(sesid, dbid, tablename, null, 0, grbit, out tableid);
if (JET_err.ObjectNotFound == err)
{
return false;
}
Api.Check((int)err);
Debug.Assert(err >= JET_err.Success, "Exception should have been thrown in case of error");
return true;
}
/// <summary>
/// Creates a dictionary which maps column names to their column IDs.
/// </summary>
/// <param name="sesid">The sesid to use.</param>
/// <param name="tableid">The table to retrieve the information for.</param>
/// <returns>A dictionary mapping column names to column IDs.</returns>
public static IDictionary<string, JET_COLUMNID> GetColumnDictionary(JET_SESID sesid, JET_TABLEID tableid)
{
JET_COLUMNLIST columnlist;
JetGetTableColumnInfo(sesid, tableid, string.Empty, out columnlist);
// As of Sep 2015, JetGetColumnInfoW is only called for Win8+. Even though Unicode should have
// worked in Win7, it wasn't reliable until Win8.
Encoding encodingOfTextColumns = EsentVersion.SupportsWindows8Features ? Encoding.Unicode : LibraryHelpers.EncodingASCII;
try
{
// esent treats column names as case-insensitive, so we want the dictionary to be case insensitive as well
var dict = new Dictionary<string, JET_COLUMNID>(
columnlist.cRecord, StringComparer.OrdinalIgnoreCase);
if (columnlist.cRecord > 0)
{
if (Api.TryMoveFirst(sesid, columnlist.tableid))
{
do
{
string name = RetrieveColumnAsString(
sesid,
columnlist.tableid,
columnlist.columnidcolumnname,
encodingOfTextColumns,
RetrieveColumnGrbit.None);
name = StringCache.TryToIntern(name);
var columnidValue =
(uint)RetrieveColumnAsUInt32(sesid, columnlist.tableid, columnlist.columnidcolumnid);
var columnid = new JET_COLUMNID { Value = columnidValue };
dict.Add(name, columnid);
}
while (TryMoveNext(sesid, columnlist.tableid));
}
}
return dict;
}
finally
{
// Close the temporary table used to return the results
JetCloseTable(sesid, columnlist.tableid);
}
}
/// <summary>
/// Get the columnid of the specified column.
/// </summary>
/// <param name="sesid">The session to use.</param>
/// <param name="tableid">The table containing the column.</param>
/// <param name="columnName">The name of the column.</param>
/// <returns>The id of the column.</returns>
public static JET_COLUMNID GetTableColumnid(JET_SESID sesid, JET_TABLEID tableid, string columnName)
{
JET_COLUMNDEF columndef;
JetGetTableColumnInfo(sesid, tableid, columnName, out columndef);
return columndef.columnid;
}
/// <summary>
/// Iterates over all the columns in the table, returning information about each one.
/// </summary>
/// <param name="sesid">The session to use.</param>
/// <param name="tableid">The table to retrieve column information for.</param>
/// <returns>An iterator over ColumnInfo for each column in the table.</returns>
public static IEnumerable<ColumnInfo> GetTableColumns(JET_SESID sesid, JET_TABLEID tableid)
{
return new GenericEnumerable<ColumnInfo>(() => new TableidColumnInfoEnumerator(sesid, tableid));
}
/// <summary>
/// Iterates over all the columns in the table, returning information about each one.
/// </summary>
/// <param name="sesid">The session to use.</param>
/// <param name="dbid">The database containing the table.</param>
/// <param name="tablename">The name of the table.</param>
/// <returns>An iterator over ColumnInfo for each column in the table.</returns>
public static IEnumerable<ColumnInfo> GetTableColumns(JET_SESID sesid, JET_DBID dbid, string tablename)
{
if (null == tablename)
{
throw new ArgumentNullException("tablename");
}
return new GenericEnumerable<ColumnInfo>(() => new TableColumnInfoEnumerator(sesid, dbid, tablename));
}
/// <summary>
/// Iterates over all the indexes in the table, returning information about each one.
/// </summary>
/// <param name="sesid">The session to use.</param>
/// <param name="tableid">The table to retrieve index information for.</param>
/// <returns>An iterator over an IndexInfo for each index in the table.</returns>
public static IEnumerable<IndexInfo> GetTableIndexes(JET_SESID sesid, JET_TABLEID tableid)
{
return new GenericEnumerable<IndexInfo>(() => new TableidIndexInfoEnumerator(sesid, tableid));
}
/// <summary>
/// Iterates over all the indexs in the table, returning information about each one.
/// </summary>
/// <param name="sesid">The session to use.</param>
/// <param name="dbid">The database containing the table.</param>
/// <param name="tablename">The name of the table.</param>
/// <returns>An iterator over an IndexInfo for each index in the table.</returns>
public static IEnumerable<IndexInfo> GetTableIndexes(JET_SESID sesid, JET_DBID dbid, string tablename)
{
if (null == tablename)
{
throw new ArgumentNullException("tablename");
}
return new GenericEnumerable<IndexInfo>(() => new TableIndexInfoEnumerator(sesid, dbid, tablename));
}
/// <summary>
/// Returns the names of the tables in the database.
/// </summary>
/// <param name="sesid">The session to use.</param>
/// <param name="dbid">The database containing the table.</param>
/// <returns>An iterator over the names of the tables in the database.</returns>
public static IEnumerable<string> GetTableNames(JET_SESID sesid, JET_DBID dbid)
{
return new GenericEnumerable<string>(() => new TableNameEnumerator(sesid, dbid));
}
/// <summary>
/// Retrieves information about indexes on a table.
/// </summary>
/// <param name="sesid">The session to use.</param>
/// <param name="tableid">The table to retrieve index information about.</param>
/// <param name="indexname">The name of the index.</param>
/// <param name="result">Filled in with information about indexes on the table.</param>
/// <param name="infoLevel">The type of information to retrieve.</param>
/// <returns>true if there was no error, false if the index wasn't found. Throws for other Jet errors.</returns>
public static bool TryJetGetTableIndexInfo(
JET_SESID sesid,
JET_TABLEID tableid,
string indexname,
out JET_INDEXID result,
JET_IdxInfo infoLevel)
{
int err = Impl.JetGetTableIndexInfo(sesid, tableid, indexname, out result, infoLevel);
if ((JET_err)err == JET_err.IndexNotFound)
{
return false;
}
Api.Check(err);
return true;
}
/// <summary>
/// Determines the name of the current index of a given cursor.
/// </summary>
/// <remarks>
/// This name is also used to later re-select that index as the current index using
/// <see cref="JetSetCurrentIndex"/>. It can also be used to discover the properties of that index using
/// JetGetTableIndexInfo.
///
/// The returned name of the index will be null if the current index is the clustered index and no primary
/// index was explicitly defined.
/// </remarks>
/// <param name="sesid">The session to use.</param>
/// <param name="tableid">The cursor to get the index name for.</param>
/// <returns>Returns the name of the index.</returns>
public static string JetGetCurrentIndex(JET_SESID sesid, JET_TABLEID tableid)
{
string indexName;
Api.JetGetCurrentIndex(sesid, tableid, out indexName, SystemParameters.NameMost);
return string.IsNullOrEmpty(indexName) ? null : indexName;
}
}
}

View File

@ -0,0 +1,244 @@
//-----------------------------------------------------------------------
// <copyright file="MoveHelpers.cs" company="Microsoft Corporation">
// Copyright (c) Microsoft Corporation.
// </copyright>
//-----------------------------------------------------------------------
namespace Microsoft.Isam.Esent.Interop
{
using System;
using System.Collections.Generic;
using System.Diagnostics;
/// <summary>
/// Helper methods for the ESENT API. These aren't interop versions
/// of the API, but encapsulate very common uses of the functions.
/// </summary>
public static partial class Api
{
/// <summary>
/// Position the cursor before the first record in the table. A
/// subsequent move next will position the cursor on the first
/// record.
/// </summary>
/// <param name="sesid">The session to use.</param>
/// <param name="tableid">The table to position.</param>
public static void MoveBeforeFirst(JET_SESID sesid, JET_TABLEID tableid)
{
Api.TryMoveFirst(sesid, tableid);
Api.TryMovePrevious(sesid, tableid);
}
/// <summary>
/// Position the cursor after the last record in the table. A
/// subsequent move previous will position the cursor on the
/// last record.
/// </summary>
/// <param name="sesid">The session to use.</param>
/// <param name="tableid">The table to position.</param>
public static void MoveAfterLast(JET_SESID sesid, JET_TABLEID tableid)
{
Api.TryMoveLast(sesid, tableid);
Api.TryMoveNext(sesid, tableid);
}
/// <summary>
/// Try to navigate through an index. If the navigation succeeds this
/// method returns true. If there is no record to navigate to this
/// method returns false; an exception will be thrown for other errors.
/// </summary>
/// <param name="sesid">The session to use.</param>
/// <param name="tableid">The cursor to position.</param>
/// <param name="move">The direction to move in.</param>
/// <param name="grbit">Move options.</param>
/// <returns>True if the move was successful.</returns>
public static bool TryMove(JET_SESID sesid, JET_TABLEID tableid, JET_Move move, MoveGrbit grbit)
{
var err = (JET_err)Impl.JetMove(sesid, tableid, (int)move, grbit);
if (JET_err.NoCurrentRecord == err)
{
return false;
}
Api.Check((int)err);
Debug.Assert(err >= JET_err.Success, "Exception should have been thrown in case of error");
return true;
}
/// <summary>
/// Try to move to the first record in the table. If the table is empty this
/// returns false, if a different error is encountered an exception is thrown.
/// </summary>
/// <param name="sesid">The session to use.</param>
/// <param name="tableid">The cursor to position.</param>
/// <returns>True if the move was successful.</returns>
public static bool TryMoveFirst(JET_SESID sesid, JET_TABLEID tableid)
{
return TryMove(sesid, tableid, JET_Move.First, MoveGrbit.None);
}
/// <summary>
/// Try to move to the last record in the table. If the table is empty this
/// returns false, if a different error is encountered an exception is thrown.
/// </summary>
/// <param name="sesid">The session to use.</param>
/// <param name="tableid">The cursor to position.</param>
/// <returns>True if the move was successful.</returns>
public static bool TryMoveLast(JET_SESID sesid, JET_TABLEID tableid)
{
return TryMove(sesid, tableid, JET_Move.Last, MoveGrbit.None);
}
/// <summary>
/// Try to move to the next record in the table. If there is not a next record
/// this returns false, if a different error is encountered an exception is thrown.
/// </summary>
/// <param name="sesid">The session to use.</param>
/// <param name="tableid">The cursor to position.</param>
/// <returns>True if the move was successful.</returns>
public static bool TryMoveNext(JET_SESID sesid, JET_TABLEID tableid)
{
return TryMove(sesid, tableid, JET_Move.Next, MoveGrbit.None);
}
/// <summary>
/// Try to move to the previous record in the table. If there is not a previous record
/// this returns false, if a different error is encountered an exception is thrown.
/// </summary>
/// <param name="sesid">The session to use.</param>
/// <param name="tableid">The cursor to position.</param>
/// <returns>True if the move was successful.</returns>
public static bool TryMovePrevious(JET_SESID sesid, JET_TABLEID tableid)
{
return TryMove(sesid, tableid, JET_Move.Previous, MoveGrbit.None);
}
/// <summary>
/// Efficiently positions a cursor to an index entry that matches the search
/// criteria specified by the search key in that cursor and the specified
/// inequality. A search key must have been previously constructed using JetMakeKey.
/// </summary>
/// <param name="sesid">The session to use.</param>
/// <param name="tableid">The cursor to position.</param>
/// <param name="grbit">Seek option.</param>
/// <returns>True if a record matching the criteria was found.</returns>
public static bool TrySeek(JET_SESID sesid, JET_TABLEID tableid, SeekGrbit grbit)
{
var err = (JET_err)Impl.JetSeek(sesid, tableid, grbit);
if (JET_err.RecordNotFound == err)
{
return false;
}
Api.Check((int)err);
Debug.Assert(err >= JET_err.Success, "Exception should have been thrown in case of error");
return true;
}
/// <summary>
/// Temporarily limits the set of index entries that the cursor can walk using
/// JetMove to those starting from the current index entry and ending at the index
/// entry that matches the search criteria specified by the search key in that cursor
/// and the specified bound criteria. A search key must have been previously constructed
/// using JetMakeKey. Returns true if the index range is non-empty, false otherwise.
/// </summary>
/// <param name="sesid">The session to use.</param>
/// <param name="tableid">The cursor to position.</param>
/// <param name="grbit">Seek option.</param>
/// <returns>True if the seek was successful.</returns>
public static bool TrySetIndexRange(JET_SESID sesid, JET_TABLEID tableid, SetIndexRangeGrbit grbit)
{
var err = (JET_err)Impl.JetSetIndexRange(sesid, tableid, grbit);
if (JET_err.NoCurrentRecord == err)
{
return false;
}
Api.Check((int)err);
Debug.Assert(err >= JET_err.Success, "Exception should have been thrown in case of error");
return true;
}
/// <summary>
/// Removes an index range created with <see cref="JetSetIndexRange"/> or
/// <see cref="TrySetIndexRange"/>. If no index range is present this
/// method does nothing.
/// </summary>
/// <param name="sesid">The session to use.</param>
/// <param name="tableid">The cursor to remove the index range on.</param>
public static void ResetIndexRange(JET_SESID sesid, JET_TABLEID tableid)
{
var err = (JET_err)Impl.JetSetIndexRange(sesid, tableid, SetIndexRangeGrbit.RangeRemove);
if (JET_err.InvalidOperation == err)
{
// this error is expected if there isn't currently an index range
return;
}
Api.Check((int)err);
return;
}
/// <summary>
/// Intersect a group of index ranges and return the bookmarks of the records which are found
/// in all the index ranges.
/// Also see <see cref="JetIntersectIndexes"/>.
/// </summary>
/// <param name="sesid">The session to use.</param>
/// <param name="tableids">
/// The tableids to use. Each tableid must be from a different index on the same table and
/// have an active index range. Use <see cref="JetSetIndexRange"/>
/// to create an index range.
/// </param>
/// <returns>
/// The bookmarks of the records which are found in all the index ranges. The bookmarks
/// are returned in primary key order.
/// </returns>
public static IEnumerable<byte[]> IntersectIndexes(JET_SESID sesid, params JET_TABLEID[] tableids)
{
if (null == tableids)
{
throw new ArgumentNullException("tableids");
}
var ranges = new JET_INDEXRANGE[tableids.Length];
for (int i = 0; i < tableids.Length; ++i)
{
ranges[i] = new JET_INDEXRANGE { tableid = tableids[i] };
}
return new GenericEnumerable<byte[]>(() => new IntersectIndexesEnumerator(sesid, ranges));
}
/// <summary>
/// Positions a cursor to an index entry for the record that is associated with
/// the specified bookmark. The bookmark can be used with any index defined over
/// a table. The bookmark for a record can be retrieved using <see cref="JetGetBookmark"/>.
/// </summary>
/// <param name="sesid">The session to use.</param>
/// <param name="tableid">The cursor to position.</param>
/// <param name="bookmark">The bookmark used to position the cursor.</param>
/// <param name="bookmarkSize">The size of the bookmark.</param>
/// <returns>True if a record matching the bookmark was found.</returns>
public static bool TryGotoBookmark(JET_SESID sesid, JET_TABLEID tableid, byte[] bookmark, int bookmarkSize)
{
var err = (JET_err)Impl.JetGotoBookmark(sesid, tableid, bookmark, bookmarkSize);
// Return false if the record no longer exists.
if (JET_err.RecordDeleted == err)
{
return false;
}
// Return false if there is no entry for this record on the current (secondary) index.
if (JET_err.NoCurrentRecord == err)
{
return false;
}
Api.Check((int)err);
Debug.Assert(err >= JET_err.Success, "Exception should have been thrown in case of error");
return true;
}
}
}

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,53 @@
//-----------------------------------------------------------------------
// <copyright file="ObjectInfoFlags.cs" company="Microsoft Corporation">
// Copyright (c) Microsoft Corporation.
// </copyright>
//-----------------------------------------------------------------------
namespace Microsoft.Isam.Esent.Interop
{
using System;
/// <summary>
/// Flags for ESENT objects (tables). Used in <see cref="JET_OBJECTINFO"/>.
/// </summary>
[Flags]
public enum ObjectInfoFlags
{
/// <summary>
/// Default options.
/// </summary>
None = 0,
/// <summary>
/// Object is for internal use only.
/// </summary>
System = -2147483648, // 0x80000000
// It's possible to use bit shift to avoid triggering fxcop CA2217.
// System = (long)0x1L << 31, // 0x80000000;
// (http://social.msdn.microsoft.com/Forums/en-US/vstscode/thread/a44aa5c1-c62a-46b7-8009-dc46ba21ba93)
// But we don't want to change the type of the enum to a long.
/// <summary>
/// Table's DDL is fixed.
/// </summary>
TableFixedDDL = 0x40000000,
/// <summary>
/// Table's DDL is inheritable.
/// </summary>
TableTemplate = 0x20000000,
/// <summary>
/// Table's DDL is inherited from a template table.
/// </summary>
TableDerived = 0x10000000,
/// <summary>
/// Fixed or variable columns in derived tables (so that fixed or variable
/// columns can be added to the template in the future).
/// Used in conjunction with <see cref="TableTemplate"/>.
/// </summary>
TableNoFixedVarColumnsInDerivedTables = 0x04000000,
}
}

View File

@ -0,0 +1,52 @@
//-----------------------------------------------------------------------
// <copyright file="ObsoleteApi.cs" company="Microsoft Corporation">
// Copyright (c) Microsoft Corporation.
// </copyright>
//-----------------------------------------------------------------------
namespace Microsoft.Isam.Esent.Interop
{
using System;
/// <summary>
/// API members that are marked as obsolete.
/// </summary>
public static partial class Api
{
/// <summary>
/// Retrieves information about indexes on a table.
/// </summary>
/// <param name="sesid">The session to use.</param>
/// <param name="dbid">The database to use.</param>
/// <param name="tablename">The name of the table to retrieve index information about.</param>
/// <param name="ignored">This parameter is ignored.</param>
/// <param name="indexlist">Filled in with information about indexes on the table.</param>
[Obsolete("Use the overload that takes a JET_IdxInfo parameter, passing in JET_IdxInfo.List")]
public static void JetGetIndexInfo(
JET_SESID sesid,
JET_DBID dbid,
string tablename,
string ignored,
out JET_INDEXLIST indexlist)
{
Api.JetGetIndexInfo(sesid, dbid, tablename, ignored, out indexlist, JET_IdxInfo.List);
}
/// <summary>
/// Retrieves information about indexes on a table.
/// </summary>
/// <param name="sesid">The session to use.</param>
/// <param name="tableid">The table to retrieve index information about.</param>
/// <param name="indexname">This parameter is ignored.</param>
/// <param name="indexlist">Filled in with information about indexes on the table.</param>
[Obsolete("Use the overload that takes a JET_IdxInfo parameter, passing in JET_IdxInfo.List")]
public static void JetGetTableIndexInfo(
JET_SESID sesid,
JET_TABLEID tableid,
string indexname,
out JET_INDEXLIST indexlist)
{
Api.JetGetTableIndexInfo(sesid, tableid, indexname, out indexlist, JET_IdxInfo.List);
}
}
}

Some files were not shown because too many files have changed in this diff Show More