Compare commits

...

1326 Commits

Author SHA1 Message Date
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
014c1eaa59
Update .appveyor.yml 2025-07-04 23:52:20 +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
4bd770d078 Update app.js 2024-01-27 00:50:25 +09:00
4db4d98f0b HIGHT(ISO/IEC 18033-3) encryption and decryption 2024-01-27 00:50:07 +09:00
453e63da2e Update app.js 2024-01-26 18:27:11 +09:00
01be6b6252 Update app.js 2024-01-26 16:58:27 +09:00
bafc0a085d Update app.js 2024-01-26 16:57:53 +09:00
79c64726e2 Update app.js 2024-01-26 16:55:49 +09:00
7d01adb54b Update HIGHT.cs 2024-01-26 16:29:22 +09:00
436ce3d88d
Update SECURITY.MD 2024-01-25 11:08:03 +09:00
d0593958e7
Update SECURITY.MD 2024-01-25 10:54:55 +09:00
0a069e3f3a
Update README.md 2024-01-25 06:14:01 +09:00
83d90a8110
Update FUNDING.yml 2024-01-25 06:12:30 +09:00
a268b5acc6
Update FUNDING.yml 2024-01-25 06:11:56 +09:00
bcdf4f9165
Update README.md 2024-01-25 06:10:54 +09:00
8f733eba64
Update README.md 2024-01-25 05:57:02 +09:00
8515627f82 Merge branch 'master' of https://github.com/gnh1201/welsonjs 2024-01-25 01:33:03 +09:00
f4b86735fb Add EncryptStringHIGHT(), DecryptStringHIGHT() 2024-01-25 01:32:59 +09:00
166dd70ef9
[lib/http] cURL error with non-escaped ampersand on Command Prompt #103 2024-01-24 19:23:39 +09:00
541078bda8 Add WelsonJS.Cryptography.HIGHT 2024-01-24 13:28:20 +09:00
cfc9501554 Update app.js, lib/std.js 2024-01-08 15:42:54 +09:00
04c2325ade
Update chrome.js 2024-01-08 01:41:35 +09:00
6a0491c419
Update README.MD 2024-01-05 21:41:14 +09:00
60854fc9df
Update README.MD 2024-01-05 21:36:39 +09:00
df8b345ddf Update README.md 2024-01-05 16:17:09 +09:00
e650915bb9 Update README.md 2024-01-05 16:11:30 +09:00
ed2f98e558 Update README.md 2024-01-05 16:05:43 +09:00
1f7a4a0778 Update README.md 2024-01-05 16:01:58 +09:00
c179b2e478 Add image 2024-01-05 16:01:15 +09:00
c0c64de20d Update NamedSharedMemory.cs 2024-01-04 18:07:04 +09:00
82deec7a81 Remove the experimental files 2024-01-04 17:51:16 +09:00
1972c4f44a experimental 2024-01-04 17:43:57 +09:00
43a56c5360 experimental 2024-01-04 17:40:41 +09:00
604fc27a59 experimental 2024-01-04 17:35:59 +09:00
f0504e12ec Update testloader.js 2024-01-04 16:14:13 +09:00
7f9840f765 Merge branch 'master' of https://github.com/gnh1201/welsonjs 2024-01-04 15:55:41 +09:00
b1a0e91dd9 Update the native component 2024-01-04 15:55:21 +09:00
097f146499 Update test-misc.json 2024-01-04 15:48:09 +09:00
11209fa8d7 Update test-misc.json 2024-01-04 15:47:57 +09:00
bd5bf9ebe0 Update testoader.js 2024-01-04 15:47:05 +09:00
28fd89f22d shared memory #96 2024-01-04 15:23:26 +09:00
dddfa3cc47 Update testloader.js #96 2024-01-04 12:05:47 +09:00
5ffdea15de fix typo 2023-12-29 15:23:24 +09:00
6fe9d097a8 shared memory 2023-12-29 15:22:20 +09:00
29a40ab83d shared memory 2023-12-29 15:09:31 +09:00
fcd53969f1 shared memory 2023-12-29 15:03:02 +09:00
1bd57f6fef Add WelsonJS.Toolkit.Experimental.dll 2023-12-28 16:11:21 +09:00
7c06504281 Add WelsonJS-WebRequest powershell script 2023-12-28 13:44:00 +09:00
c9dbcc24e3
Update README.md 2023-12-28 13:20:11 +09:00
83abad910a Add screenshot 3 2023-12-28 13:16:51 +09:00
65abb93ee5
Update README.md 2023-12-28 13:02:40 +09:00
924e581fbb
Add files via upload 2023-12-28 13:02:13 +09:00
44573236f7 Update app.js 2023-12-28 11:48:39 +09:00
0d5660726d Update app.js 2023-12-28 11:48:27 +09:00
2775e277fd Update app.js 2023-12-28 11:46:33 +09:00
9c1250ac22
Update chrome.js 2023-12-27 03:51:35 +09:00
80dfe4c915 Update chrome.js 2023-12-27 03:31:54 +09:00
285e90494d
Update preconfigure.bat 2023-12-27 02:11:29 +09:00
3e19d03cd1 IEMaxScriptStatements.bat and registerDLLs.bat is merged to preconfigure.bat 2023-12-27 02:10:12 +09:00
04e7dc82af Update chrome.js 2023-12-27 01:33:43 +09:00
e8e617658c Remove unused libraries, Fix the rendering-related resources 2023-12-23 05:13:25 +09:00
df3ee0331c Update WelsonJS.Toolkit.csproj 2023-12-23 01:55:35 +09:00
d3ae29ffdd Update README.MD 2023-12-22 18:15:50 +09:00
5d1a539e9b
Update README.MD 2023-12-22 18:11:50 +09:00
30f60fd304
Update README.MD 2023-12-22 18:11:03 +09:00
ca8a0af14e Update README.MD 2023-12-22 18:03:01 +09:00
e0b915faec Update README.MD 2023-12-22 17:59:37 +09:00
5aa9eb1392 Update README.MD 2023-12-22 17:58:26 +09:00
320063ad1d Update README.MD 2023-12-22 17:54:58 +09:00
ec70b2e648 Update README.MD 2023-12-22 17:54:03 +09:00
084535597d Update README.MD 2023-12-22 17:52:27 +09:00
5ef2cd92bf Update README.MD 2023-12-22 17:50:50 +09:00
573d8c76d3 Update the additional binaries information 2023-12-22 17:49:07 +09:00
e7068f0f97 Add LZ77 (MsCompress) algorithm implementation 2023-12-22 16:00:08 +09:00
3cfc3fccf5 Update lib/toolkit.js 2023-12-20 17:58:42 +09:00
0d3052e659 Update lib/std.js, lib/toolkit.js 2023-12-20 17:01:24 +09:00
31b28f2945 Update testloader.js 2023-12-19 07:20:33 +09:00
f6d756f92b msoffice #93 2023-12-19 06:47:48 +09:00
92dedd182e Update officeloader.js 2023-12-19 05:56:16 +09:00
5f487d9409 Update lib/msoffice, officeloader #93 2023-12-19 05:12:05 +09:00
94a0b66c12
Update SECURITY.MD 2023-12-18 15:11:13 +09:00
28edbcc135
Update SECURITY.MD 2023-12-18 15:10:35 +09:00
f1982dd69e
Update SECURITY.MD 2023-12-18 15:01:45 +09:00
08e87edb71 Update native component 2023-12-17 00:12:19 +09:00
ba47a7f62d Update native component 2023-12-17 00:11:42 +09:00
9bc4621962 Updated native component source code 2023-12-16 23:42:17 +09:00
e74afcf112 Merge branch 'master' of https://github.com/gnh1201/welsonjs 2023-12-14 04:47:51 +09:00
44fa579390 [Toolkit] Access to a shared memory #96 2023-12-14 04:47:47 +09:00
c7682acbd2
Update SECURITY.MD 2023-12-14 03:26:58 +09:00
821629eb5a
Update SECURITY.MD 2023-12-14 03:25:28 +09:00
32020e0d84
Update msoffice.js 2023-12-11 18:18:47 +09:00
35eb144ce8
Update msoffice.js (compatibility) 2023-12-11 18:18:25 +09:00
a000958f99
Update msoffice.js 2023-12-11 18:10:15 +09:00
3fbb73e3e1
Update msoffice.js 2023-12-11 18:09:53 +09:00
00f92f0eb9
Update msoffice.js 2023-12-11 17:58:31 +09:00
bf796ed61c
Update msoffice.js 2023-12-11 17:56:31 +09:00
2b524dcb13
Update msoffice.js 2023-12-11 17:53:40 +09:00
79bc3fe593 Update lib/system.js and related files 2023-12-11 16:54:21 +09:00
c4dfca7c62 Update app.js, helloworld.js 2023-12-11 16:10:55 +09:00
ecbef69860
Update app.js 2023-12-11 15:35:33 +09:00
fffd5eb872
Update FUNDING.yml 2023-12-11 14:38:05 +09:00
0283ad1bc2
Update app.js 2023-12-11 14:22:00 +09:00
871fe130af Update app.js 2023-12-11 12:42:33 +09:00
0266da168f
Update app.js 2023-12-11 12:10:54 +09:00
7659507e9e
Update app.js 2023-12-11 11:40:31 +09:00
4e3b7f7aee
Update app.js 2023-12-11 11:20:36 +09:00
0eebb269f0
Update README.md 2023-12-04 19:01:58 +09:00
2596bef850
Update README.md 2023-12-04 18:59:22 +09:00
e502256bed
Update binaries_meta.json 2023-12-01 22:35:30 +09:00
99bdbc41ba
Update binaries_meta.json 2023-12-01 22:33:43 +09:00
4d19c93814
Update binaries_meta.json 2023-12-01 21:55:09 +09:00
7e30b4ab1a
Update and rename bin_profile.json to binaries_meta.json 2023-12-01 21:23:47 +09:00
349f3589ff
Update bin_profile.json 2023-12-01 16:25:59 +09:00
049d1ee294
Update bin_profile.json 2023-12-01 16:17:47 +09:00
a3dcc8fbd7
Update bin_profile.json 2023-12-01 16:14:03 +09:00
f87ecc0e45
Create bin_profile.json 2023-12-01 15:41:18 +09:00
1fda56bd7e Cleanup a legacy 2023-11-28 01:50:34 +09:00
5858dff783
Update README.MD 2023-11-28 01:45:24 +09:00
b87aad537a Change the calling convention excel.getCellByPosition() to excel.getCellByPosition(x, y).setValue() 2023-11-28 00:51:54 +09:00
44c6e22dc8 MS Office #93 2023-11-27 19:14:11 +09:00
ae04570d40 Support Microsoft Excel #93 + ChatGPT 2023-11-27 18:20:54 +09:00
796918e07e ChatGPT + MS Office 2023-11-27 18:03:22 +09:00
848bded217 msoffice.js 2023-11-27 17:04:01 +09:00
52888517ee lib/msoffice.js, officetest.js 2023-11-27 16:56:18 +09:00
4558db2d5e Create msoffice.js 2023-11-24 17:36:28 +09:00
aecd998301
Update README.md 2023-11-24 16:28:17 +09:00
4bf9cb4c5c Add WYSIWYG HTML Editor #92 2023-11-22 18:02:03 +09:00
95a6324e18
Update README.md 2023-11-14 17:51:01 +09:00
22c140dcbd
Update README.md 2023-11-14 17:49:05 +09:00
088e4c9010
Update README.md 2023-11-14 17:48:02 +09:00
9e6d39abb4
Update FUNDING.yml 2023-11-14 17:38:28 +09:00
fc3697217a
Update README.md 2023-11-10 10:29:08 +09:00
795d121422 fix typo 2023-11-07 11:37:05 +09:00
543f7b61e7 Remove gtk.demo.js, toolkit.demo.js, squel.demo.js, and merge to testloader.js 2023-11-07 11:24:36 +09:00
f8ee2cf3e5 Remove gtk.demo.js and merge to testloader.js 2023-11-07 11:04:21 +09:00
4fde95bbf6 Update testloader.js 2023-11-06 12:07:10 +09:00
4906799170 Fix Enumerator.toArray method and related issues 2023-11-06 11:23:09 +09:00
da36ad57be Update lib/http.js, testloader.js 2023-10-31 05:49:11 +09:00
0efc455cf9 Update testloader.js and more 2023-10-31 05:41:52 +09:00
f393a99dc5 Update 2023-10-31 03:13:02 +09:00
4ea98b1540 Update 2023-10-31 02:02:02 +09:00
934009a6c0 Update 2023-10-30 19:51:48 +09:00
141c7709b3 Update test-oss-20231030.json 2023-10-30 17:17:56 +09:00
ceb7de458e Update app/index.js, app/test.html, testloader.js 2023-10-30 17:14:31 +09:00
0f4dfcef20 Update app.hta, app/index.js, app/signin.html, app/test.html 2023-10-30 16:58:29 +09:00
c3e9d1b179 Add GUI Router 2023-10-30 16:11:51 +09:00
79fb080e9f Update testloader,js, and test profile 2023-10-30 14:36:22 +09:00
28474ad477 Update testloader.js 2023-10-30 14:01:37 +09:00
bfd826a0ea Change "utf-8" to FILE.CdoCharset.CdoUTF_8 2023-10-30 13:56:43 +09:00
feef8e9f73 Update lib/file.js, testloader..js 2023-10-30 13:41:43 +09:00
6e5e1b99e2 Create the test profile 2023-10-30 12:55:48 +09:00
9ff1f617b8
Fixed bug: broken GUI sample #86
Fixed bug: broken GUI sample #86, Reported by @eogloblin, in 2023-10-26
2023-10-26 18:59:01 +09:00
1a460afaa2
Update system.js 2023-10-24 11:13:19 +09:00
130d3d1569
Update pipe-ipc.js 2023-09-26 14:44:37 +09:00
5d3d2a06d7
Update http.js 2023-09-26 11:57:35 +09:00
0fbd38db9f
Update setup.iss 2023-09-26 11:57:13 +09:00
2e625a6392
Update package.json 2023-09-26 11:56:59 +09:00
ea5a70e03d
Update pipe-ipc.js 2023-09-26 11:24:12 +09:00
20ac966a61
Update pipe-ipc.js 2023-09-22 14:46:40 +09:00
c3435f7aac
Update pipe-ipc.js 2023-09-22 14:43:29 +09:00
c0dc768588
Update file.js 2023-09-21 21:45:26 +09:00
f904b43777
Update pipe-ipc.js 2023-09-21 21:44:26 +09:00
01b5e7d46f
Update shell.js 2023-09-21 21:13:24 +09:00
ae82ef5d95
Update file.js 2023-09-21 20:47:43 +09:00
9b0e67a12a
Update pipe-ipc.js 2023-09-21 20:46:56 +09:00
d4214f7f34
Update shell.js 2023-09-21 18:58:28 +09:00
6b55a2d0de
Update pipe-ipc.js 2023-09-21 18:57:42 +09:00
c4ccdaf1aa
Update file.js 2023-09-21 18:55:35 +09:00
2d72f6a87b
Update pipe-ipc.js 2023-09-21 16:58:30 +09:00
34668ad54e
Update pipe-ipc.js 2023-09-21 16:53:58 +09:00
88482f5ba8
Update file.js 2023-09-21 16:39:49 +09:00
2b27f369bd
Update shell.js 2023-09-21 15:08:52 +09:00
f22364b2f9
Update pipe-ipc.js 2023-09-21 15:08:03 +09:00
cbac701e7e
Update http.js 2023-09-21 15:07:22 +09:00
2912ca8b4b
Update http.js 2023-09-21 10:59:51 +09:00
7acb695877
Update shell.js 2023-09-21 10:59:22 +09:00
c9c6d87803
Update file.js 2023-09-20 19:07:50 +09:00
59e76de85d
Update pipe-ipc.js 2023-09-20 19:07:18 +09:00
44a9a32775
Merge pull request #82 from gnh1201/pipe-ipc-shell
Enhance the shell interface with PIPE IPC
2023-09-20 16:48:11 +09:00
3999bcc171
Update pipe-ipc.js 2023-09-20 14:59:30 +09:00
30f16cf3e8
Update shell.js 2023-09-20 14:35:21 +09:00
04ec2586a5
Update pipe-ipc.js 2023-09-20 14:32:27 +09:00
01cfdb0f72
Update shell.js 2023-09-20 12:27:38 +09:00
b60ef15c91
Update pipe-ipc.js 2023-09-20 12:25:52 +09:00
a035304803
Update pipe-ipc.js 2023-09-19 19:28:04 +09:00
d05d4deb03
Create ipctest.js 2023-09-19 16:37:14 +09:00
9080a177f1
Merge pull request #81 from gnh1201/pipe-ipc-file
Pipe ipc file
2023-09-19 16:32:10 +09:00
f40a45c5f1
Update pipe-ipc.js 2023-09-19 16:23:09 +09:00
e28f346447
Update file.js 2023-09-19 16:08:24 +09:00
7a1086108c
Update pipe-ipc.js 2023-09-19 16:07:39 +09:00
de20821b98
Update file.js 2023-09-19 15:55:45 +09:00
3baaf8dd2b
Update pipe-ipc.js 2023-09-19 15:54:31 +09:00
4a3d044f02
Update pipe-ipc.js 2023-09-18 23:25:18 +09:00
145be2a894
Update pipe-ipc.js 2023-09-18 21:06:23 +09:00
26fbacf695
Update system.js 2023-09-13 12:26:05 +09:00
6ff0f3cbd3
Update system.js 2023-09-13 12:24:29 +09:00
686 changed files with 165372 additions and 6855 deletions

48
.appveyor.yml Normal file
View File

@ -0,0 +1,48 @@
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\EsentInterop\bin\%CONFIGURATION%\* artifacts\
- cmd: nuget pack WelsonJS.Toolkit\WelsonJS.Toolkit\ -properties Configuration=%CONFIGURATION% -properties Platform=x86 -OutputDirectory artifacts\
- 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 #{{build}} {{status}}'
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

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 }}

15
.gitignore vendored
View File

@ -103,8 +103,13 @@ dist
# TernJS port file
.tern-port
# Custom directories and files
bin/
packages/
config.xml
staticip.xml
# user private assets
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

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=**

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"

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.net>.
<!-- 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,5 +0,0 @@
# These are supported funding model platforms
github: gnh1201, catswords
patreon: catswords # Replace with a single Patreon username
custom: ['https://www.buymeacoffee.com/catswords']

View File

@ -1,4 +0,0 @@
@echo off
reg add "HKCU\Software\Microsoft\Internet Explorer\Styles" /f
reg add "HKCU\Software\Microsoft\Internet Explorer\Styles" /v "MaxScriptStatements" /t REG_DWORD /d 0xFFFFFFFF /f

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.
@ -13,14 +12,14 @@ A "contributor" is any person that distributes its contribution under this licen
"Licensed patents" are a contributor's patent claims that read directly on its contribution.
2. Grant of Rights
(A) Copyright Grant- Subject to the terms of this license, including the license conditions and limitations in section 3, each contributor grants you a non-exclusive, worldwide, royalty-free copyright license to reproduce its contribution, prepare derivative works of its contribution, and distribute its contribution or any derivative works that you create.
(A) Copyright Grant - Subject to the terms of this license, including the license conditions and limitations in section 3, each contributor grants you a non-exclusive, worldwide, royalty-free copyright license to reproduce its contribution, prepare derivative works of its contribution, and distribute its contribution or any derivative works that you create.
(B) Patent Grant- Subject to the terms of this license, including the license conditions and limitations in section 3, each contributor grants you a non-exclusive, worldwide, royalty-free license under its licensed patents to make, have made, use, sell, offer for sale, import, and/or otherwise dispose of its contribution in the software or derivative works of the contribution in the software.
3. Conditions and Limitations
(A) Reciprocal Grants- For any file you distribute that contains code from the software (in source code or binary format), you must provide recipients the source code to that file along with a copy of this license, which license will govern that file. You may license other files that are entirely your own work and do not contain code from the software under any terms you choose.
(A) Reciprocal Grants - For any file you distribute that contains code from the software (in source code or binary format), you must provide recipients the source code to that file along with a copy of this license, which license will govern that file. You may license other files that are entirely your own work and do not contain code from the software under any terms you choose.
(B) No Trademark License- This license does not grant you rights to use any contributors' name, logo, or trademarks.
(B) No Trademark License - This license does not grant you rights to use any contributors' name, logo, or trademarks.
(C) If you bring a patent claim against any contributor over patents that you claim are infringed by the software, your patent license from such contributor to the software ends automatically.
@ -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) 소프트웨어는 "있는 그대로" 사용이 허가됩니다. 당신은 그것을 사용할 위험을 감수합니다. 기여자는 명시적 보증, 보증 또는 조건을 제공하지 않습니다. 귀하는 현지 법률에 따라 이 라이선스가 변경할 수 없는 추가적인 소비자 권리를 가질 수 있습니다. 현지 법률에서 허용하는 범위 내에서 기여자는 상품성, 특정 목적에의 적합성 및 비침해성에 대한 묵시적 보증을 배제합니다.

240
README.md
View File

@ -1,91 +1,105 @@
# welsonjs
WelsonJS - Build a Windows app on the Windows built-in JavaScript engine.
We can build a Windows desktop app with JavaScript, TypeScript, ReScript, and HTML/CSS on WSH(Windows Script Host)
[![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)](https://catswords-oss.rdbl.io/5719744820/5510319392)
[![Anthropic available](https://img.shields.io/badge/Anthropic-000000?logo=Anthropic&logoColor=white)](https://catswords-oss.rdbl.io/5719744820/5510319392)
[![Grok available](https://img.shields.io/badge/Grok-000000?logo=x&logoColor=white)](https://catswords-oss.rdbl.io/5719744820/5510319392)
[![Google Gemini available](https://img.shields.io/badge/Google%20Gemini-886FBF?logo=googlegemini&logoColor=fff)](https://catswords-oss.rdbl.io/5719744820/5510319392)
[![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)
[![Open to work](https://img.shields.io/badge/%23-OPENTOWORK-green)](https://github.com/gnh1201/welsonjs/discussions/167)
[![Buy me a coffee](https://cdn.buymeacoffee.com/buttons/v2/default-yellow.png)](https://www.buymeacoffee.com/catswords/thanks-welsonjs-users)
<img src="app/assets/img/logo.svg" height="32" alt=""/> WelsonJS - Build a Windows app on the Windows built-in JavaScript engine.
WelsonJS = ***W***indows + ***El***ectr***on***-like + ***Javascript(JS)***
![A Cover Image: Windows in 1999](https://ics.catswords.net/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.
WelsonJS = ***W***indows + ***El***ectr***on***-like + ***Javascript(JS)*** + :heart:[Contributions](https://github.com/sponsors/gnh1201)
* :kissing_cat: [Download Latest WelsonJS Launcher (ics.catswords.net)](https://ics.catswords.net/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://ics.catswords.net/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://ics.catswords.net/logo_oss.gif" height="32" alt=""/> [Open SW Portal](https://oss.kr), NIPA National IT Industry Promotion Agency<sup>(정보통신산업진흥원)</sup>
* <img src="https://ics.catswords.net/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://ics.catswords.net/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://ics.catswords.net/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](https://catswords-oss.rdbl.io/5719744820/8278298336) ([ScrapeOps](https://scrapeops.io?fpr=namhyeon75), [AviationStack](https://aviationstack.com?utm_source=FirstPromoter&utm_medium=Affiliate&fpr=namhyeon71), [Coupang](https://link.coupang.com/a/b7HV3V)...)
## 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:zloirock/core-js](https://github.com/zloirock/core-js)
- [github:douglascrockford/JSON-js](https://github.com/douglascrockford/JSON-js) (aka. JSON2.js)
- [github:nodeca/js-yaml](https://github.com/nodeca/js-yaml)
- HTML5, CSS3 compatibility
- [github:aFarkas/html5shiv](https://github.com/aFarkas/html5shiv)
- [github:parndt/jquery-html5-placeholder-shim](https://github.com/parndt/jquery-html5-placeholder-shim)
- [github:scottjehl/Respond](https://github.com/scottjehl/Respond)
- [github:keithclark/selectivizr](https://github.com/keithclark/selectivizr)
- [github:arv/ExplorerCanvas](https://github.com/arv/ExplorerCanvas)
- [github:etianen/html5media](https://github.com/etianen/html5media)
- [github:Modernizr/Modernizr](https://github.com/Modernizr/Modernizr)
- Default CSS Framework
- [github:jslegers/cascadeframework](https://github.com/jslegers/cascadeframework)
- Included libraries
- [jQuery](https://jquery.com/)
- [jQuery UI](https://jqueryui.com/)
- [github:kamranahmedse/jquery-toast-plugin](https://github.com/kamranahmedse/jquery-toast-plugin)
- [github:hiddentao/squel](https://github.com/hiddentao/squel)
- [github: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](https://catswords-oss.rdbl.io/5719744820/1706431912)
* 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)
* Generative AI integrations: [Multiple LLM and sLLM](https://catswords-oss.rdbl.io/5719744820/5510319392) (e.g., ChatGPT, Claude, ...)
* 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)
* VM infrastructure tool integrations: [OVFTool for Broadcom/VMware infrastructures](https://developer.broadcom.com/tools/open-virtualization-format-ovf-tool/latest)
* ***:fire: NEW!*** Windows bulit-in database engine AKA. [ESENT (ESE) database](https://learn.microsoft.com/en-us/windows/win32/extensible-storage-engine/database-overview) interface library (WelsonJS.Esent)
* Everything you can imagine.
## Included libraries
- lib/std (Standard library)
- lib/system (System library)
- lib/base64 (BASE64 Encode and Decode)
- lib/db (Database interface)
- lib/file (File I/O interface)
- lib/http (HTTP interface)
- lib/json (JSON Encode and Decode)
- lib/registry (Windows Registry interface)
- lib/security (Security Policy interface)
- lib/sendmail (Sendmail interface with 3rdparty)
- lib/shell (Command Prompt interface)
- lib/timer (`setTimeout` polyfills)
- lib/powershell (Windows Powershell interface)
- lib/service (Windows Service interface)
- lib/oldbrowser (ES5/ES6, HTML/JS/CSS compatibility)
- 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/shadowsocks ([Shadowsocks](https://shadowsocks.org/) interface)
- lib/excel (Microsoft Excel interface)
- lib/vbscript (VBScript interface)
- lib/wintap (Windows-TAP interface)
- lib/tun2socks (TUN2SOCKS interface)
- lib/hosts (Hosts file 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)
## Make your own `sayhello` example
## Quick start
### 1. Write a file `lib/sayhello.js`
```
exports.VERSIONINFO = "SayHello Library (sayhello.js) version 0.1
exports.global = global;
exports.require = global.require;
exports.say = function() {
```js
// lib/sayhello.js
function say() {
console.log("hello");
}
exports.say = say;
exports.VERSIONINFO = "SayHello (sayhello.js) version 0.1";
exports.AUTHOR = "gnh1201@catswords.re.kr";
exports.global = global;
exports.require = global.require;
```
### 2. Write a file `sayhello.js`
```
```js
// sayhello.js
var SayHello = require("lib/sayhello");
function main() {
@ -97,43 +111,75 @@ function main() {
exports.main = main;
```
### 3. Execute file on the command prompt
```
C:\Users\John\Documents\GitHub\welsonjs> cscript app.js sayhello
### 3. Execute script on the console
```cmd
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](https://catswords-oss.rdbl.io/5719744820/4131485779).
* **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://ics.catswords.net/screenshot.png)
## Thanks!
![Thanks 1](app/assets/img/thanks.png)
![(Screenshot 2) Command-line environment](https://ics.catswords.net/screenshot2.png)
- https://www.facebook.com/javascript4u/posts/1484014618472735
- https://python5.com/q/xtbsqjxb
![(Screenshot 3) WelsonJS with Microsoft Excel](https://ics.catswords.net/screenshot3.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 4) Write a Windows Services with JavaScript](https://ics.catswords.net/screenshot4.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 5) Template Matching on the computer screen](https://ics.catswords.net/screenshot5.png)
## Contact me
If you have any inquiries regarding this project or if you are interested in becoming a partner, please don't hesitate to contact us. Particularly, for those using this project for website quality improvement automation, technical support will be exclusively available to partners.
![(Screenshot 6) The Launcher for WelsonJS Application Packages](https://ics.catswords.net/screenshot6.png)
- abuse@catswords.net
- ActivityPub [@catswords_oss@catswords.social](https://catswords.social/@catswords_oss)
![(Screenshot 7) Microsoft Monaco Editor on WelsonJS Launcher](https://ics.catswords.net/screenshot7.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
* :eyes: [Facebook Group "Javascript Programming"(javascript4u)](https://www.facebook.com/javascript4u/posts/build-a-windows-desktop-apps-with-javascript-html-and-cssmorioh-javascript-html-/1484014618472735/)
* :eyes: [morioh.com](https://morioh.com/a/23c427a82bf1/build-a-windows-desktop-apps-with-javascript-html-and-css)
* :eyes: CSDN
* :eyes: 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: Fediverse
* :eyes: [Hacker News](https://news.ycombinator.com/item?id=41316782)
* :eyes: [WebToolsWeekly](https://webtoolsweekly.com/archives/issue-585/)
* :eyes: [GeekNews](https://news.hada.io/weekly/202441) in GeekNews Weekly (2024-09-30 ~ 2024-10-06)
* :eyes: [daily.dev](https://app.daily.dev/posts/js-libraries-svg-tools-json-databases-8quregz3a)
* :eyes: [PitchHut](https://www.pitchhut.com/project/proj_Ya136OLSW5at)
* :eyes: [Disquiet](https://dis.qa/nv6T6)
* :eyes: [Node Weekly](https://nodeweekly.com/issues/582)
## 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)
## 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.
* [Join the private operations channel (forms.gle)](https://forms.gle/ZKAAaGTiGamksHoo8) is available for all regions.
## 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,38 +1,63 @@
# 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)
* Online video streaming quality testing and improvement.
* 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, 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 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.
2. If you are looking for ways to use WelsonJS more efficiently, referencing the [LOLBAS (Living Off The Land Binaries and Scripts)](https://lolbas-project.github.io/) list can be helpful.
1. If you plan to use WelsonJS for a purpose other than those mentioned above, please contact us beforehand.
2. If you are looking for ways to use WelsonJS more efficiently, referencing the [LOLBAS (Living Off The Land Binaries and Scripts)](https://lolbas-project.github.io/) list can be helpful.
## 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 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://ics.catswords.net/1494315-Certificate%2BSoR-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://ics.catswords.net/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)
## Report abuse
If you discover any instances of this project being misused, please report them.
* [GitHub Security Advisories](https://github.com/gnh1201/welsonjs/security)
* [abuse@catswords.net](mailto:abuse@catswords.net)
* abuse@catswords.net
* ActivityPub [@catswords_oss@catswords.social](https://catswords.social/@catswords_oss)
## 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.
* [Join the private operations channel (forms.gle)](https://forms.gle/ZKAAaGTiGamksHoo8) is available for all regions.

Binary file not shown.

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,109 @@
<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 Include="Esent\CallbackDataConverter.cs" />
<Compile Include="Esent\EsentJetApi.cs" />
<Compile Include="Esent\EsentNativeMethods.cs" />
<Compile Include="Esent\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<Folder Include="Properties\" />
</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);
}
}
}

View File

@ -0,0 +1,44 @@
//-----------------------------------------------------------------------
// <copyright file="OnlineMaintenanceHelpers.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
{
/// <summary>
/// Starts and stops database defragmentation tasks that improves data
/// organization within a database.
/// </summary>
/// <param name="sesid">The session to use for the call.</param>
/// <param name="dbid">The database to be defragmented.</param>
/// <param name="tableName">
/// Under some options defragmentation is performed for the entire database described by the given
/// database ID, and other options (such as <see cref="Windows7.Windows7Grbits.DefragmentBTree"/>) require
/// the name of the table to defragment.
/// </param>
/// <param name="grbit">Defragmentation options.</param>
/// <returns>A warning code.</returns>
/// <seealso cref="Api.JetDefragment"/>
public static JET_wrn Defragment(
JET_SESID sesid,
JET_DBID dbid,
string tableName,
DefragGrbit grbit)
{
return Api.Check(Impl.Defragment(sesid, dbid, tableName, grbit));
}
}
}

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,50 @@
//-----------------------------------------------------------------------
// <copyright file="Server2003Api.cs" company="Microsoft Corporation">
// Copyright (c) Microsoft Corporation.
// </copyright>
//-----------------------------------------------------------------------
namespace Microsoft.Isam.Esent.Interop.Server2003
{
/// <summary>
/// APIs that have been added to the Windows Server 2003 version of ESENT.
/// </summary>
public static class Server2003Api
{
#if !MANAGEDESENT_ON_WSA
/// <summary>
/// Notifies the engine that it can resume normal IO operations after a
/// freeze period ended with a failed snapshot.
/// </summary>
/// <param name="snapid">Identifier of the snapshot session.</param>
/// <param name="grbit">Options for this call.</param>
public static void JetOSSnapshotAbort(JET_OSSNAPID snapid, SnapshotAbortGrbit grbit)
{
Api.Check(Api.Impl.JetOSSnapshotAbort(snapid, grbit));
}
#endif // !MANAGEDESENT_ON_WSA
/// <summary>
/// The JetUpdate function performs an update operation including inserting a new row into
/// a table or updating an existing row. Deleting a table row is performed by calling
/// <see cref="Api.JetDelete"/>.
/// </summary>
/// <param name="sesid">The session which started the update.</param>
/// <param name="tableid">The cursor to update. An update should be prepared.</param>
/// <param name="bookmark">Returns the bookmark of the updated record. This can be null.</param>
/// <param name="bookmarkSize">The size of the bookmark buffer.</param>
/// <param name="actualBookmarkSize">Returns the actual size of the bookmark.</param>
/// <param name="grbit">Update options.</param>
/// <remarks>
/// JetUpdate is the final step in performing an insert or an update. The update is begun by
/// calling <see cref="Api.JetPrepareUpdate"/> and then by calling
/// <see cref="Api.JetSetColumn(JET_SESID,JET_TABLEID,JET_COLUMNID,byte[],int,SetColumnGrbit,JET_SETINFO)"/>
/// one or more times to set the record state. Finally, <see cref="JetUpdate2"/>
/// is called to complete the update operation. Indexes are updated only by JetUpdate or and not during JetSetColumn.
/// </remarks>
public static void JetUpdate2(JET_SESID sesid, JET_TABLEID tableid, byte[] bookmark, int bookmarkSize, out int actualBookmarkSize, UpdateGrbit grbit)
{
Api.Check(Api.Impl.JetUpdate2(sesid, tableid, bookmark, bookmarkSize, out actualBookmarkSize, grbit));
}
}
}

View File

@ -0,0 +1,108 @@
//-----------------------------------------------------------------------
// <copyright file="Server2003Grbits.cs" company="Microsoft Corporation">
// Copyright (c) Microsoft Corporation.
// </copyright>
//-----------------------------------------------------------------------
namespace Microsoft.Isam.Esent.Interop.Server2003
{
using System;
#if !MANAGEDESENT_ON_WSA // Not exposed in MSDK
/// <summary>
/// Options for <see cref="Server2003Api.JetOSSnapshotAbort"/>.
/// </summary>
[Flags]
public enum SnapshotAbortGrbit
{
/// <summary>
/// Default options.
/// </summary>
None = 0,
}
#endif // !MANAGEDESENT_ON_WSA
/// <summary>
/// Options for <see cref="Server2003Api.JetUpdate2"/>.
/// </summary>
[Flags]
public enum UpdateGrbit
{
/// <summary>
/// Default options.
/// </summary>
None = 0,
#if !MANAGEDESENT_ON_WSA // Not exposed in MSDK
/// <summary>
/// This flag causes the update to return an error if the update would
/// not have been possible in the Windows 2000 version of ESE, which
/// enforced a smaller maximum number of multi-valued column instances
/// in each record than later versions of ESE. This is important only
/// for applications that wish to replicate data between applications
/// hosted on Windows 2000 and applications hosted on Windows
/// 2003, or later versions of ESE. It should not be necessary for most
/// applications.
/// </summary>
[Obsolete("Only needed for legacy replication applications.")]
CheckESE97Compatibility = 0x1,
#endif // !MANAGEDESENT_ON_WSA
}
/// <summary>
/// Grbits that have been added to the Windows Server 2003 version of ESENT.
/// </summary>
public static class Server2003Grbits
{
/// <summary>
/// Delete all indexes with unicode columns.
/// </summary>
public const AttachDatabaseGrbit DeleteUnicodeIndexes = (AttachDatabaseGrbit)0x400;
/// <summary>
/// When the escrow-update column reaches a value of zero (after all
/// versions are resolve), the record will be deleted. A common use for
/// a column that can be finalized is to use it as a reference count
/// field, and when the field reaches zero the record gets deleted. A
/// Delete-on-zero column must be an escrow update / <see cref="ColumndefGrbit.ColumnEscrowUpdate"/>
/// column. ColumnDeleteOnZero cannot be used with ColumnFinalize.
/// ColumnDeleteOnZero cannot be used with user defined default columns.
/// </summary>
public const ColumndefGrbit ColumnDeleteOnZero = (ColumndefGrbit)0x20000;
/// <summary>
/// This option requests that the temporary table only be created if the
/// temporary table manager can use the implementation optimized for
/// intermediate query results. If any characteristic of the temporary
/// table would prevent the use of this optimization then the operation
/// will fail with JET_errCannotMaterializeForwardOnlySort. A side effect
/// of this option is to allow the temporary table to contain records
/// with duplicate index keys. See <see cref="TempTableGrbit.Unique"/>
/// for more information.
/// </summary>
public const TempTableGrbit ForwardOnly = (TempTableGrbit)0x40;
/// <summary>
/// If a given column is not present in the record and it has a user
/// defined default value then no column value will be returned.
/// This option will prevent the callback that computes the user defined
/// default value for the column from being called when enumerating
/// the values for that column.
/// </summary>
/// <remarks>
/// This option is only available for Windows Server 2003 SP1 and later
/// operating systems.
/// </remarks>
public const EnumerateColumnsGrbit EnumerateIgnoreUserDefinedDefault = (EnumerateColumnsGrbit)0x00100000;
/// <summary>
/// All transactions previously committed by any session that have not
/// yet been flushed to the transaction log file will be flushed immediately.
/// This API will wait until the transactions have been flushed before
/// returning to the caller. This option may be used even if the session
/// is not currently in a transaction. This option cannot be used in
/// combination with any other option.
/// </summary>
public const CommitTransactionGrbit WaitAllLevel0Commit = (CommitTransactionGrbit)0x8;
}
}

View File

@ -0,0 +1,24 @@
//-----------------------------------------------------------------------
// <copyright file="Server2003Param.cs" company="Microsoft Corporation">
// Copyright (c) Microsoft Corporation.
// </copyright>
//-----------------------------------------------------------------------
namespace Microsoft.Isam.Esent.Interop.Server2003
{
/// <summary>
/// System parameters that have been added to the Windows Server 2003 version of ESENT.
/// </summary>
public static class Server2003Param
{
/// <summary>
/// The full path to each database is persisted in the transaction logs
/// at run time. Ordinarily, these databases must remain at the original
/// location for transaction replay to function correctly. This
/// parameter can be used to force crash recovery or a restore operation
/// to look for the databases referenced in the transaction log in the
/// specified folder.
/// </summary>
public const JET_param AlternateDatabaseRecoveryPath = (JET_param)113;
}
}

View File

@ -0,0 +1,89 @@
//-----------------------------------------------------------------------
// <copyright file="Session.cs" company="Microsoft Corporation">
// Copyright (c) Microsoft Corporation.
// </copyright>
//-----------------------------------------------------------------------
namespace Microsoft.Isam.Esent.Interop
{
using System.Globalization;
/// <summary>
/// A class that encapsulates a JET_SESID in a disposable object.
/// </summary>
public class Session : EsentResource
{
/// <summary>
/// The underlying JET_SESID.
/// </summary>
private JET_SESID sesid;
/// <summary>
/// Initializes a new instance of the Session class. A new
/// JET_SESSION is allocated from the given instance.
/// </summary>
/// <param name="instance">The instance to start the session in.</param>
public Session(JET_INSTANCE instance)
{
Api.JetBeginSession(instance, out this.sesid, null, null);
this.ResourceWasAllocated();
}
/// <summary>
/// Gets the JET_SESID that this session contains.
/// </summary>
public JET_SESID JetSesid
{
get
{
this.CheckObjectIsNotDisposed();
return this.sesid;
}
}
/// <summary>
/// Implicit conversion operator from a Session to a JET_SESID. This
/// allows a Session to be used with APIs which expect a JET_SESID.
/// </summary>
/// <param name="session">The session to convert.</param>
/// <returns>The JET_SESID of the session.</returns>
public static implicit operator JET_SESID(Session session)
{
return session.JetSesid;
}
/// <summary>
/// Returns a <see cref="T:System.String"/> that represents the current <see cref="Session"/>.
/// </summary>
/// <returns>
/// A <see cref="T:System.String"/> that represents the current <see cref="Session"/>.
/// </returns>
public override string ToString()
{
return string.Format(CultureInfo.InvariantCulture, "Session (0x{0:x})", this.sesid.Value);
}
/// <summary>
/// Terminate the session.
/// </summary>
public void End()
{
this.CheckObjectIsNotDisposed();
this.ReleaseResource();
}
/// <summary>
/// Free the underlying JET_SESID.
/// </summary>
protected override void ReleaseResource()
{
if (!this.sesid.IsInvalid)
{
Api.JetEndSession(this.JetSesid, EndSessionGrbit.None);
}
this.sesid = JET_SESID.Nil;
this.ResourceWasReleased();
}
}
}

View File

@ -0,0 +1,544 @@
//-----------------------------------------------------------------------
// <copyright file="SetColumnHelpers.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.Runtime.Serialization;
#if MANAGEDESENT_SUPPORTS_SERIALIZATION
using System.Runtime.Serialization.Formatters.Binary;
#endif
using System.Text;
using Microsoft.Isam.Esent.Interop.Vista;
using Microsoft.Isam.Esent.Interop.Windows10;
/// <summary>
/// Helper methods for the ESENT API. These do data conversion for
/// setting columns.
/// </summary>
public static partial class Api
{
/// <summary>
/// Modifies a single column value in a modified record to be inserted or to
/// update the current record.
/// </summary>
/// <param name="sesid">The session to use.</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="encoding">The encoding used to convert the string.</param>
public static void SetColumn(
JET_SESID sesid, JET_TABLEID tableid, JET_COLUMNID columnid, string data, Encoding encoding)
{
SetColumn(sesid, tableid, columnid, data, encoding, SetColumnGrbit.None);
}
/// <summary>
/// Modifies a single column value in a modified record to be inserted or to
/// update the current record.
/// </summary>
/// <param name="sesid">The session to use.</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="encoding">The encoding used to convert the string.</param>
/// <param name="grbit">SetColumn options.</param>
public static void SetColumn(
JET_SESID sesid, JET_TABLEID tableid, JET_COLUMNID columnid, string data, Encoding encoding, SetColumnGrbit grbit)
{
CheckEncodingIsValid(encoding);
if (null == data)
{
JetSetColumn(sesid, tableid, columnid, null, 0, grbit, null);
}
else if (0 == data.Length)
{
JetSetColumn(sesid, tableid, columnid, null, 0, grbit | SetColumnGrbit.ZeroLength, null);
}
else if (Encoding.Unicode == encoding)
{
// Optimization for setting Unicode strings.
unsafe
{
fixed (char* buffer = data)
{
JetSetColumn(
sesid,
tableid,
columnid,
new IntPtr(buffer),
checked(data.Length * sizeof(char)),
grbit,
null);
}
}
}
else if (encoding.GetMaxByteCount(data.Length) <= Caches.ColumnCache.BufferSize)
{
#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);
unsafe
{
fixed (byte* bytes = buffer)
{
JetSetColumn(sesid, tableid, columnid, new IntPtr(bytes), buffer.Length, grbit, null);
}
}
#else
// The encoding output will fix in a cached buffer. Get one to avoid
// more memory allocations.
byte[] buffer = null;
try
{
buffer = Caches.ColumnCache.Allocate();
unsafe
{
fixed (char* chars = data)
fixed (byte* bytes = buffer)
{
int dataSize = encoding.GetBytes(chars, data.Length, bytes, buffer.Length);
JetSetColumn(sesid, tableid, columnid, new IntPtr(bytes), dataSize, grbit, null);
}
}
}
finally
{
if (buffer != null)
{
Caches.ColumnCache.Free(ref buffer);
}
}
#endif
}
else
{
byte[] bytes = encoding.GetBytes(data);
JetSetColumn(sesid, tableid, columnid, bytes, bytes.Length, grbit, null);
}
}
/// <summary>
/// Modifies a single column value in a modified record to be inserted or to
/// update the current record.
/// </summary>
/// <param name="sesid">The session to use.</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>
public static void SetColumn(JET_SESID sesid, JET_TABLEID tableid, JET_COLUMNID columnid, byte[] data)
{
SetColumn(sesid, tableid, columnid, data, SetColumnGrbit.None);
}
/// <summary>
/// Modifies a single column value in a modified record to be inserted or to
/// update the current record.
/// </summary>
/// <param name="sesid">The session to use.</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="grbit">SetColumn options.</param>
public static void SetColumn(JET_SESID sesid, JET_TABLEID tableid, JET_COLUMNID columnid, byte[] data, SetColumnGrbit grbit)
{
int dataLength = (null == data) ? 0 : data.Length;
SetColumn(sesid, tableid, columnid, data, dataLength, grbit);
}
/// <summary>
/// Modifies a single column value in a modified record to be inserted or to
/// update the current record.
/// </summary>
/// <param name="sesid">The session to use.</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>
public static void SetColumn(JET_SESID sesid, JET_TABLEID tableid, JET_COLUMNID columnid, byte[] data, int dataSize, SetColumnGrbit grbit)
{
if ((null != data) && (0 == data.Length))
{
grbit |= SetColumnGrbit.ZeroLength;
}
if (data == null && dataSize > 0)
{
throw new ArgumentException(string.Format("data is null, but dataSize is: {0}", dataSize));
}
if (data != null && data.Length < dataSize)
{
throw new ArgumentException(string.Format("data.Length is less, than dataSize: data.Length={0}, dataSize={1}", data.Length, dataSize));
}
JetSetColumn(sesid, tableid, columnid, data, dataSize, grbit, null);
}
/// <summary>
/// Modifies a single column value in a modified record to be inserted or to
/// update the current record.
/// </summary>
/// <param name="sesid">The session to use.</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>
public static void SetColumn(JET_SESID sesid, JET_TABLEID tableid, JET_COLUMNID columnid, bool data)
{
byte b = data ? (byte)0xff : (byte)0x0;
SetColumn(sesid, tableid, columnid, b);
}
/// <summary>
/// Modifies a single column value in a modified record to be inserted or to
/// update the current record.
/// </summary>
/// <param name="sesid">The session to use.</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>
public static void SetColumn(JET_SESID sesid, JET_TABLEID tableid, JET_COLUMNID columnid, byte data)
{
unsafe
{
const int DataSize = sizeof(byte);
var pointer = new IntPtr(&data);
JetSetColumn(sesid, tableid, columnid, pointer, DataSize, SetColumnGrbit.None, null);
}
}
/// <summary>
/// Modifies a single column value in a modified record to be inserted or to
/// update the current record.
/// </summary>
/// <param name="sesid">The session to use.</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>
public static void SetColumn(JET_SESID sesid, JET_TABLEID tableid, JET_COLUMNID columnid, short data)
{
unsafe
{
const int DataSize = sizeof(short);
var pointer = new IntPtr(&data);
JetSetColumn(sesid, tableid, columnid, pointer, DataSize, SetColumnGrbit.None, null);
}
}
/// <summary>
/// Modifies a single column value in a modified record to be inserted or to
/// update the current record.
/// </summary>
/// <param name="sesid">The session to use.</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>
public static void SetColumn(JET_SESID sesid, JET_TABLEID tableid, JET_COLUMNID columnid, int data)
{
unsafe
{
const int DataSize = sizeof(int);
var pointer = new IntPtr(&data);
JetSetColumn(sesid, tableid, columnid, pointer, DataSize, SetColumnGrbit.None, null);
}
}
/// <summary>
/// Modifies a single column value in a modified record to be inserted or to
/// update the current record.
/// </summary>
/// <param name="sesid">The session to use.</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>
public static void SetColumn(JET_SESID sesid, JET_TABLEID tableid, JET_COLUMNID columnid, long data)
{
unsafe
{
const int DataSize = sizeof(long);
var pointer = new IntPtr(&data);
JetSetColumn(sesid, tableid, columnid, pointer, DataSize, SetColumnGrbit.None, null);
}
}
/// <summary>
/// Modifies a single column value in a modified record to be inserted or to
/// update the current record.
/// </summary>
/// <param name="sesid">The session to use.</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>
public static void SetColumn(JET_SESID sesid, JET_TABLEID tableid, JET_COLUMNID columnid, Guid data)
{
unsafe
{
const int DataSize = 16; // sizeof(Guid) isn't a compile-time constant
var pointer = new IntPtr(&data);
JetSetColumn(sesid, tableid, columnid, pointer, DataSize, SetColumnGrbit.None, null);
}
}
/// <summary>
/// Modifies a single column value in a modified record to be inserted or to
/// update the current record.
/// </summary>
/// <param name="sesid">The session to use.</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>
public static void SetColumn(JET_SESID sesid, JET_TABLEID tableid, JET_COLUMNID columnid, DateTime data)
{
SetColumn(sesid, tableid, columnid, data.ToOADate());
}
/// <summary>
/// Modifies a single column value in a modified record to be inserted or to
/// update the current record.
/// </summary>
/// <param name="sesid">The session to use.</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>
public static void SetColumn(JET_SESID sesid, JET_TABLEID tableid, JET_COLUMNID columnid, float data)
{
unsafe
{
const int DataSize = sizeof(float);
var pointer = new IntPtr(&data);
JetSetColumn(sesid, tableid, columnid, pointer, DataSize, SetColumnGrbit.None, null);
}
}
/// <summary>
/// Modifies a single column value in a modified record to be inserted or to
/// update the current record.
/// </summary>
/// <param name="sesid">The session to use.</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>
public static void SetColumn(JET_SESID sesid, JET_TABLEID tableid, JET_COLUMNID columnid, double data)
{
unsafe
{
const int DataSize = sizeof(double);
var pointer = new IntPtr(&data);
JetSetColumn(sesid, tableid, columnid, pointer, DataSize, SetColumnGrbit.None, null);
}
}
/// <summary>
/// Perform atomic addition on an Int32 column. The column must be of type
/// <see cref="JET_coltyp.Long"/>. This function allows multiple sessions to update the
/// same record concurrently without conflicts.
/// </summary>
/// <remarks>
/// This method wraps <see cref="JetEscrowUpdate"/>.
/// </remarks>
/// <param name="sesid">The session to use.</param>
/// <param name="tableid">The cursor to update.</param>
/// <param name="columnid">The column to update. This must be an escrow-updatable column.</param>
/// <param name="delta">The delta to apply to the column.</param>
/// <returns>The current value of the column as stored in the database (versioning is ignored).</returns>
public static int EscrowUpdate(JET_SESID sesid, JET_TABLEID tableid, JET_COLUMNID columnid, int delta)
{
var previousValue = new byte[sizeof(int)];
int actualPreviousValueLength;
JetEscrowUpdate(
sesid,
tableid,
columnid,
BitConverter.GetBytes(delta),
sizeof(int),
previousValue,
previousValue.Length,
out actualPreviousValueLength,
EscrowUpdateGrbit.None);
Debug.Assert(
previousValue.Length == actualPreviousValueLength,
"Unexpected previous value length. Expected an Int32");
return BitConverter.ToInt32(previousValue, 0);
}
/// <summary>
/// Perform atomic addition on an Int64 column. The column must be of type
/// <see cref="VistaColtyp.LongLong"/>. This function allows multiple sessions to update the
/// same record concurrently without conflicts.
/// </summary>
/// <remarks>
/// This method wraps <see cref="JetEscrowUpdate"/>.
/// </remarks>
/// <param name="sesid">The session to use.</param>
/// <param name="tableid">The cursor to update.</param>
/// <param name="columnid">The column to update. This must be an escrow-updatable column.</param>
/// <param name="delta">The delta to apply to the column.</param>
/// <returns>The current value of the column as stored in the database (versioning is ignored).</returns>
public static long EscrowUpdate(JET_SESID sesid, JET_TABLEID tableid, JET_COLUMNID columnid, long delta)
{
var previousValue = new byte[sizeof(long)];
int actualPreviousValueLength;
JetEscrowUpdate(
sesid,
tableid,
columnid,
BitConverter.GetBytes(delta),
sizeof(long),
previousValue,
previousValue.Length,
out actualPreviousValueLength,
EscrowUpdateGrbit.None);
Debug.Assert(
previousValue.Length == actualPreviousValueLength,
"Unexpected previous value length. Expected an Int64");
return BitConverter.ToInt64(previousValue, 0);
}
/// <summary>
/// Modifies a single column value in a modified record to be inserted or to
/// update the current record.
/// </summary>
/// <param name="sesid">The session to use.</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>
[CLSCompliant(false)]
public static void SetColumn(JET_SESID sesid, JET_TABLEID tableid, JET_COLUMNID columnid, ushort data)
{
unsafe
{
const int DataSize = sizeof(ushort);
var pointer = new IntPtr(&data);
JetSetColumn(sesid, tableid, columnid, pointer, DataSize, SetColumnGrbit.None, null);
}
}
/// <summary>
/// Modifies a single column value in a modified record to be inserted or to
/// update the current record.
/// </summary>
/// <param name="sesid">The session to use.</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>
[CLSCompliant(false)]
public static void SetColumn(JET_SESID sesid, JET_TABLEID tableid, JET_COLUMNID columnid, uint data)
{
unsafe
{
const int DataSize = sizeof(uint);
var pointer = new IntPtr(&data);
JetSetColumn(sesid, tableid, columnid, pointer, DataSize, SetColumnGrbit.None, null);
}
}
/// <summary>
/// Modifies a single column value in a modified record to be inserted or to
/// update the current record.
/// </summary>
/// <param name="sesid">The session to use.</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>
[CLSCompliant(false)]
public static void SetColumn(JET_SESID sesid, JET_TABLEID tableid, JET_COLUMNID columnid, ulong data)
{
unsafe
{
const int DataSize = sizeof(ulong);
var pointer = new IntPtr(&data);
JetSetColumn(sesid, tableid, columnid, pointer, DataSize, SetColumnGrbit.None, null);
}
}
#if MANAGEDESENT_SUPPORTS_SERIALIZATION
/// <summary>
/// Write a serialized form of an object to a column.
/// </summary>
/// <param name="sesid">The session to use.</param>
/// <param name="tableid">The table to write to. An update should be prepared.</param>
/// <param name="columnid">The column to write to.</param>
/// <param name="value">The object to write. The object must be serializable.</param>
[SuppressMessage("Exchange.Security", "EX0043:DoNotUseBinarySoapFormatter", Justification = "Suppress warning in current code base.The usage has already been verified.")]
public static void SerializeObjectToColumn(JET_SESID sesid, JET_TABLEID tableid, JET_COLUMNID columnid, object value)
{
if (null == value)
{
Api.SetColumn(sesid, tableid, columnid, null);
}
else
{
using (var stream = new ColumnStream(sesid, tableid, columnid))
{
var serializer = new BinaryFormatter
{
Context = new StreamingContext(StreamingContextStates.Persistence)
};
serializer.Serialize(stream, value);
}
}
}
#endif
/// <summary>
/// Sets columns from ColumnValue objects.
/// </summary>
/// <param name="sesid">The session to use.</param>
/// <param name="tableid">The cursor to update. An update should be prepared.</param>
/// <param name="values">The values to set.</param>
public static void SetColumns(JET_SESID sesid, JET_TABLEID tableid, params ColumnValue[] values)
{
if (null == values)
{
throw new ArgumentNullException("values");
}
if (0 == values.Length)
{
throw new ArgumentOutOfRangeException("values", values.Length, "must have at least one value");
}
unsafe
{
NATIVE_SETCOLUMN* nativeSetcolumns = stackalloc NATIVE_SETCOLUMN[values.Length];
Api.Check(values[0].SetColumns(sesid, tableid, values, nativeSetcolumns, 0));
}
}
/// <summary>
/// Verifies that the given encoding is valid for setting/retrieving data. Only
/// the ASCII and Unicode encodings are allowed. An <see cref="ArgumentOutOfRangeException"/>
/// is thrown if the encoding isn't valid.
/// </summary>
/// <param name="encoding">The encoding to check.</param>
private static void CheckEncodingIsValid(Encoding encoding)
{
#if MANAGEDESENT_ON_CORECLR
string webName = encoding.WebName;
if (webName != "utf-8" && webName != "utf-16")
{
throw new ArgumentOutOfRangeException(
"encoding", webName, "Invalid Encoding type. Only Unicode (utf-8 and utf-16) encodings are allowed.");
}
#else
const int AsciiCodePage = 20127; // from MSDN
const int UnicodeCodePage = 1200; // from MSDN
int codePage = encoding.CodePage;
if ((AsciiCodePage != codePage) && (UnicodeCodePage != codePage))
{
throw new ArgumentOutOfRangeException(
"encoding", codePage, "Invalid Encoding type. Only ASCII and Unicode encodings are allowed");
}
#endif
}
}
}

View File

@ -0,0 +1,78 @@
<StyleCopSettings Version="105">
<GlobalSettings>
<BooleanProperty Name="WriteCache">False</BooleanProperty>
<CollectionProperty Name="RecognizedWords">
<Value>api</Value>
<Value>coltyp</Value>
<Value>columndef</Value>
<Value>columnid</Value>
<Value>dbid</Value>
<Value>dll</Value>
<Value>ese</Value>
<Value>esent</Value>
<Value>grbit</Value>
<Value>grbits</Value>
<Value>interop</Value>
<Value>itag</Value>
<Value>lgpos</Value>
<Value>param</Value>
<Value>preread</Value>
<Value>sesid</Value>
<Value>tableid</Value>
</CollectionProperty>
</GlobalSettings>
<Analyzers>
<Analyzer AnalyzerId="StyleCop.CSharp.NamingRules">
<AnalyzerSettings>
<CollectionProperty Name="Hungarian">
<Value>c</Value>
<Value>cb</Value>
<Value>dw</Value>
<Value>f</Value>
<Value>h</Value>
<Value>ib</Value>
<Value>l</Value>
<Value>p</Value>
<Value>pv</Value>
<Value>rg</Value>
<Value>sz</Value>
<Value>ul</Value>
<Value>w</Value>
</CollectionProperty>
</AnalyzerSettings>
</Analyzer>
<Analyzer AnalyzerId="StyleCop.CSharp.DocumentationRules">
<Rules>
<Rule Name="DocumentationTextMustBeginWithACapitalLetter">
<RuleSettings>
<BooleanProperty Name="Enabled">True</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="DocumentationTextMustEndWithAPeriod">
<RuleSettings>
<BooleanProperty Name="Enabled">True</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="FileHeaderFileNameDocumentationMustMatchTypeName">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
</Rules>
<AnalyzerSettings>
<StringProperty Name="CompanyName">Microsoft Corporation</StringProperty>
<StringProperty Name="Copyright">Copyright (c) Microsoft Corporation.</StringProperty>
</AnalyzerSettings>
</Analyzer>
<Analyzer AnalyzerId="StyleCop.CSharp.MaintainabilityRules">
<Rules>
<Rule Name="FileMayOnlyContainASingleNamespace">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
</Rules>
<AnalyzerSettings />
</Analyzer>
</Analyzers>
</StyleCopSettings>

View File

@ -0,0 +1,166 @@
//-----------------------------------------------------------------------
// <copyright file="StringCache.cs" company="Microsoft Corporation">
// Copyright (c) Microsoft Corporation.
// </copyright>
//-----------------------------------------------------------------------
namespace Microsoft.Isam.Esent.Interop
{
using System;
/// <summary>
/// Class that helps cache strings.
/// </summary>
internal static class StringCache
{
/// <summary>
/// Don't cache strings whose length is longer than this.
/// </summary>
private const int MaxLengthToCache = 128;
/// <summary>
/// Number of converted strings to hash.
/// </summary>
private const int NumCachedBoxedValues = 1031;
/// <summary>
/// Cached string values.
/// </summary>
private static readonly string[] CachedStrings = new string[NumCachedBoxedValues];
/// <summary>
/// Return the interned version of a string, or the original
/// string if it isn't interned.
/// </summary>
/// <param name="s">The string to try to intern.</param>
/// <returns>An interned copy of the string or the original string.</returns>
public static string TryToIntern(string s)
{
#if MANAGEDESENT_ON_WSA
// new Windows UI Core CLR does not support string interning.
return s;
#else
return string.IsInterned(s) ?? s;
#endif
}
/// <summary>
/// Convert a byte array to a string.
/// </summary>
/// <param name="value">The bytes to convert.</param>
/// <param name="startIndex">The starting index of the data to convert.</param>
/// <param name="count">The number of bytes to convert.</param>
/// <returns>A string converted from the data.</returns>
public static string GetString(byte[] value, int startIndex, int count)
{
unsafe
{
fixed (byte* data = value)
{
char* chars = (char*)(data + startIndex);
return GetString(chars, 0, count / sizeof(char));
}
}
}
/// <summary>
/// Convert a char array to a string, using a cached value if possible.
/// </summary>
/// <param name="value">The characters to convert.</param>
/// <param name="startIndex">The starting index of the data to convert.</param>
/// <param name="count">The number of characters to convert.</param>
/// <returns>A string converted from the data.</returns>
private static unsafe string GetString(char* value, int startIndex, int count)
{
string s;
if (0 == count)
{
s = string.Empty;
}
else if (count < MaxLengthToCache)
{
uint hash = CalculateHash(value, startIndex, count);
int index = unchecked((int)(hash % NumCachedBoxedValues));
s = CachedStrings[index];
if (null == s || !AreEqual(s, value, startIndex, count))
{
s = CreateNewString(value, startIndex, count);
CachedStrings[index] = s;
}
}
else
{
s = CreateNewString(value, startIndex, count);
}
return s;
}
/// <summary>
/// Calculate the hash of a string.
/// </summary>
/// <param name="value">The characters to hash.</param>
/// <param name="startIndex">The starting index of the data to hash.</param>
/// <param name="count">The number of characters to hash.</param>
/// <returns>The hash value of the data.</returns>
private static unsafe uint CalculateHash(char* value, int startIndex, int count)
{
uint hash = 0;
unchecked
{
for (int i = 0; i < count; ++i)
{
hash ^= value[startIndex + i];
hash *= 33;
}
}
return hash;
}
/// <summary>
/// Determine if a string matches a char array..
/// </summary>
/// <param name="s">The string to compare against.</param>
/// <param name="value">The characters.</param>
/// <param name="startIndex">The starting index of the data.</param>
/// <param name="count">The number of characters.</param>
/// <returns>True if the string matches the char array.</returns>
private static unsafe bool AreEqual(string s, char* value, int startIndex, int count)
{
if (s.Length != count)
{
return false;
}
unchecked
{
for (int i = 0; i < s.Length; ++i)
{
if (s[i] != value[startIndex + i])
{
return false;
}
}
}
return true;
}
/// <summary>
/// Convert a char array to a string.
/// </summary>
/// <param name="value">The characters to convert.</param>
/// <param name="startIndex">The starting index of the data to convert.</param>
/// <param name="count">The number of characters to convert.</param>
/// <returns>A string converted from the data.</returns>
private static unsafe string CreateNewString(char* value, int startIndex, int count)
{
// Encoding.Unicode.GetString copies the data to an array of chars and then
// makes a string from it, copying the data twice. Use the more efficient
// char* constructor.
return new string(value, startIndex, count);
}
}
}

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