summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.vscode/launch.json25
-rw-r--r--bin/API-MS-Win-core-xstate-l2-1-0.dllbin0 -> 2560 bytes
-rw-r--r--bin/api-ms-win-core-console-l1-1-0.dllbin0 -> 18696 bytes
-rw-r--r--bin/api-ms-win-core-datetime-l1-1-0.dllbin0 -> 18184 bytes
-rw-r--r--bin/api-ms-win-core-debug-l1-1-0.dllbin0 -> 18184 bytes
-rw-r--r--bin/api-ms-win-core-errorhandling-l1-1-0.dllbin0 -> 18184 bytes
-rw-r--r--bin/api-ms-win-core-file-l1-1-0.dllbin0 -> 21768 bytes
-rw-r--r--bin/api-ms-win-core-file-l1-2-0.dllbin0 -> 18184 bytes
-rw-r--r--bin/api-ms-win-core-file-l2-1-0.dllbin0 -> 18184 bytes
-rw-r--r--bin/api-ms-win-core-handle-l1-1-0.dllbin0 -> 18184 bytes
-rw-r--r--bin/api-ms-win-core-heap-l1-1-0.dllbin0 -> 18184 bytes
-rw-r--r--bin/api-ms-win-core-interlocked-l1-1-0.dllbin0 -> 18696 bytes
-rw-r--r--bin/api-ms-win-core-libraryloader-l1-1-0.dllbin0 -> 19208 bytes
-rw-r--r--bin/api-ms-win-core-localization-l1-2-0.dllbin0 -> 20744 bytes
-rw-r--r--bin/api-ms-win-core-memory-l1-1-0.dllbin0 -> 18696 bytes
-rw-r--r--bin/api-ms-win-core-namedpipe-l1-1-0.dllbin0 -> 18184 bytes
-rw-r--r--bin/api-ms-win-core-processenvironment-l1-1-0.dllbin0 -> 19208 bytes
-rw-r--r--bin/api-ms-win-core-processthreads-l1-1-0.dllbin0 -> 20232 bytes
-rw-r--r--bin/api-ms-win-core-processthreads-l1-1-1.dllbin0 -> 18696 bytes
-rw-r--r--bin/api-ms-win-core-profile-l1-1-0.dllbin0 -> 17672 bytes
-rw-r--r--bin/api-ms-win-core-rtlsupport-l1-1-0.dllbin0 -> 17672 bytes
-rw-r--r--bin/api-ms-win-core-string-l1-1-0.dllbin0 -> 18184 bytes
-rw-r--r--bin/api-ms-win-core-synch-l1-1-0.dllbin0 -> 20232 bytes
-rw-r--r--bin/api-ms-win-core-synch-l1-2-0.dllbin0 -> 18696 bytes
-rw-r--r--bin/api-ms-win-core-sysinfo-l1-1-0.dllbin0 -> 19208 bytes
-rw-r--r--bin/api-ms-win-core-timezone-l1-1-0.dllbin0 -> 18696 bytes
-rw-r--r--bin/api-ms-win-core-util-l1-1-0.dllbin0 -> 18184 bytes
-rw-r--r--bin/api-ms-win-crt-conio-l1-1-0.dllbin0 -> 19208 bytes
-rw-r--r--bin/api-ms-win-crt-convert-l1-1-0.dllbin0 -> 22280 bytes
-rw-r--r--bin/api-ms-win-crt-environment-l1-1-0.dllbin0 -> 18696 bytes
-rw-r--r--bin/api-ms-win-crt-filesystem-l1-1-0.dllbin0 -> 20232 bytes
-rw-r--r--bin/api-ms-win-crt-heap-l1-1-0.dllbin0 -> 19208 bytes
-rw-r--r--bin/api-ms-win-crt-locale-l1-1-0.dllbin0 -> 18696 bytes
-rw-r--r--bin/api-ms-win-crt-math-l1-1-0.dllbin0 -> 28936 bytes
-rw-r--r--bin/api-ms-win-crt-multibyte-l1-1-0.dllbin0 -> 26376 bytes
-rw-r--r--bin/api-ms-win-crt-private-l1-1-0.dllbin0 -> 72968 bytes
-rw-r--r--bin/api-ms-win-crt-process-l1-1-0.dllbin0 -> 19208 bytes
-rw-r--r--bin/api-ms-win-crt-runtime-l1-1-0.dllbin0 -> 22792 bytes
-rw-r--r--bin/api-ms-win-crt-stdio-l1-1-0.dllbin0 -> 24328 bytes
-rw-r--r--bin/api-ms-win-crt-string-l1-1-0.dllbin0 -> 24328 bytes
-rw-r--r--bin/api-ms-win-crt-time-l1-1-0.dllbin0 -> 20744 bytes
-rw-r--r--bin/api-ms-win-crt-utility-l1-1-0.dllbin0 -> 18696 bytes
-rw-r--r--bin/ffi.dllbin0 -> 104960 bytes
-rw-r--r--bin/filesystem.dllbin0 -> 57856 bytes
-rw-r--r--bin/lpeglabel.dllbin0 -> 38400 bytes
-rw-r--r--bin/lua.exebin0 -> 34304 bytes
-rw-r--r--bin/lua53.dllbin0 -> 235520 bytes
-rw-r--r--bin/msvcp140.dllbin0 -> 462120 bytes
-rw-r--r--bin/vcruntime140.dllbin0 -> 87352 bytes
-rw-r--r--bin/ydbase.dllbin0 -> 175616 bytes
-rw-r--r--bin/yue.dllbin0 -> 785408 bytes
-rw-r--r--src/utility.lua21
-rw-r--r--test/global_protect.lua10
-rw-r--r--test/main.lua10
54 files changed, 66 insertions, 0 deletions
diff --git a/.vscode/launch.json b/.vscode/launch.json
new file mode 100644
index 00000000..4fd55b1e
--- /dev/null
+++ b/.vscode/launch.json
@@ -0,0 +1,25 @@
+{
+ "version": "0.2.0",
+ "configurations": [
+ {
+ "name": "测试",
+ "type": "lua",
+ "request": "launch",
+ "stopOnEntry": false,
+ "program": "${workspaceRoot}/test/main.lua",
+ "cwd": "${workspaceRoot}",
+ "env": {
+ "PATH": "${workspaceRoot}\\bin\\"
+ },
+ "luaRuntime": "5.3 32bit",
+ "luaexe": "${workspaceRoot}\\bin\\lua.exe",
+ "luadll": "${workspaceRoot}\\bin\\lua53.dll",
+ "path": "${workspaceRoot}/bin/?.lua",
+ "cpath": "${workspaceRoot}/bin/?.dll;",
+ "arg": [
+ ],
+ "consoleCoding": "utf8",
+ "sourceCoding": "utf8"
+ }
+ ]
+}
diff --git a/bin/API-MS-Win-core-xstate-l2-1-0.dll b/bin/API-MS-Win-core-xstate-l2-1-0.dll
new file mode 100644
index 00000000..064d9c7f
--- /dev/null
+++ b/bin/API-MS-Win-core-xstate-l2-1-0.dll
Binary files differ
diff --git a/bin/api-ms-win-core-console-l1-1-0.dll b/bin/api-ms-win-core-console-l1-1-0.dll
new file mode 100644
index 00000000..d991b177
--- /dev/null
+++ b/bin/api-ms-win-core-console-l1-1-0.dll
Binary files differ
diff --git a/bin/api-ms-win-core-datetime-l1-1-0.dll b/bin/api-ms-win-core-datetime-l1-1-0.dll
new file mode 100644
index 00000000..eb960250
--- /dev/null
+++ b/bin/api-ms-win-core-datetime-l1-1-0.dll
Binary files differ
diff --git a/bin/api-ms-win-core-debug-l1-1-0.dll b/bin/api-ms-win-core-debug-l1-1-0.dll
new file mode 100644
index 00000000..1f84ace6
--- /dev/null
+++ b/bin/api-ms-win-core-debug-l1-1-0.dll
Binary files differ
diff --git a/bin/api-ms-win-core-errorhandling-l1-1-0.dll b/bin/api-ms-win-core-errorhandling-l1-1-0.dll
new file mode 100644
index 00000000..07b393ef
--- /dev/null
+++ b/bin/api-ms-win-core-errorhandling-l1-1-0.dll
Binary files differ
diff --git a/bin/api-ms-win-core-file-l1-1-0.dll b/bin/api-ms-win-core-file-l1-1-0.dll
new file mode 100644
index 00000000..2ad839ff
--- /dev/null
+++ b/bin/api-ms-win-core-file-l1-1-0.dll
Binary files differ
diff --git a/bin/api-ms-win-core-file-l1-2-0.dll b/bin/api-ms-win-core-file-l1-2-0.dll
new file mode 100644
index 00000000..ca52643a
--- /dev/null
+++ b/bin/api-ms-win-core-file-l1-2-0.dll
Binary files differ
diff --git a/bin/api-ms-win-core-file-l2-1-0.dll b/bin/api-ms-win-core-file-l2-1-0.dll
new file mode 100644
index 00000000..b9798e0e
--- /dev/null
+++ b/bin/api-ms-win-core-file-l2-1-0.dll
Binary files differ
diff --git a/bin/api-ms-win-core-handle-l1-1-0.dll b/bin/api-ms-win-core-handle-l1-1-0.dll
new file mode 100644
index 00000000..1fabaeee
--- /dev/null
+++ b/bin/api-ms-win-core-handle-l1-1-0.dll
Binary files differ
diff --git a/bin/api-ms-win-core-heap-l1-1-0.dll b/bin/api-ms-win-core-heap-l1-1-0.dll
new file mode 100644
index 00000000..0c78d9b6
--- /dev/null
+++ b/bin/api-ms-win-core-heap-l1-1-0.dll
Binary files differ
diff --git a/bin/api-ms-win-core-interlocked-l1-1-0.dll b/bin/api-ms-win-core-interlocked-l1-1-0.dll
new file mode 100644
index 00000000..f30ea8b3
--- /dev/null
+++ b/bin/api-ms-win-core-interlocked-l1-1-0.dll
Binary files differ
diff --git a/bin/api-ms-win-core-libraryloader-l1-1-0.dll b/bin/api-ms-win-core-libraryloader-l1-1-0.dll
new file mode 100644
index 00000000..346770fc
--- /dev/null
+++ b/bin/api-ms-win-core-libraryloader-l1-1-0.dll
Binary files differ
diff --git a/bin/api-ms-win-core-localization-l1-2-0.dll b/bin/api-ms-win-core-localization-l1-2-0.dll
new file mode 100644
index 00000000..1e5072f4
--- /dev/null
+++ b/bin/api-ms-win-core-localization-l1-2-0.dll
Binary files differ
diff --git a/bin/api-ms-win-core-memory-l1-1-0.dll b/bin/api-ms-win-core-memory-l1-1-0.dll
new file mode 100644
index 00000000..ca54325f
--- /dev/null
+++ b/bin/api-ms-win-core-memory-l1-1-0.dll
Binary files differ
diff --git a/bin/api-ms-win-core-namedpipe-l1-1-0.dll b/bin/api-ms-win-core-namedpipe-l1-1-0.dll
new file mode 100644
index 00000000..0338d576
--- /dev/null
+++ b/bin/api-ms-win-core-namedpipe-l1-1-0.dll
Binary files differ
diff --git a/bin/api-ms-win-core-processenvironment-l1-1-0.dll b/bin/api-ms-win-core-processenvironment-l1-1-0.dll
new file mode 100644
index 00000000..da33c1a3
--- /dev/null
+++ b/bin/api-ms-win-core-processenvironment-l1-1-0.dll
Binary files differ
diff --git a/bin/api-ms-win-core-processthreads-l1-1-0.dll b/bin/api-ms-win-core-processthreads-l1-1-0.dll
new file mode 100644
index 00000000..0baacbba
--- /dev/null
+++ b/bin/api-ms-win-core-processthreads-l1-1-0.dll
Binary files differ
diff --git a/bin/api-ms-win-core-processthreads-l1-1-1.dll b/bin/api-ms-win-core-processthreads-l1-1-1.dll
new file mode 100644
index 00000000..cdd9a887
--- /dev/null
+++ b/bin/api-ms-win-core-processthreads-l1-1-1.dll
Binary files differ
diff --git a/bin/api-ms-win-core-profile-l1-1-0.dll b/bin/api-ms-win-core-profile-l1-1-0.dll
new file mode 100644
index 00000000..5fcfd92c
--- /dev/null
+++ b/bin/api-ms-win-core-profile-l1-1-0.dll
Binary files differ
diff --git a/bin/api-ms-win-core-rtlsupport-l1-1-0.dll b/bin/api-ms-win-core-rtlsupport-l1-1-0.dll
new file mode 100644
index 00000000..2735c669
--- /dev/null
+++ b/bin/api-ms-win-core-rtlsupport-l1-1-0.dll
Binary files differ
diff --git a/bin/api-ms-win-core-string-l1-1-0.dll b/bin/api-ms-win-core-string-l1-1-0.dll
new file mode 100644
index 00000000..2ab518ad
--- /dev/null
+++ b/bin/api-ms-win-core-string-l1-1-0.dll
Binary files differ
diff --git a/bin/api-ms-win-core-synch-l1-1-0.dll b/bin/api-ms-win-core-synch-l1-1-0.dll
new file mode 100644
index 00000000..56447809
--- /dev/null
+++ b/bin/api-ms-win-core-synch-l1-1-0.dll
Binary files differ
diff --git a/bin/api-ms-win-core-synch-l1-2-0.dll b/bin/api-ms-win-core-synch-l1-2-0.dll
new file mode 100644
index 00000000..0d22398b
--- /dev/null
+++ b/bin/api-ms-win-core-synch-l1-2-0.dll
Binary files differ
diff --git a/bin/api-ms-win-core-sysinfo-l1-1-0.dll b/bin/api-ms-win-core-sysinfo-l1-1-0.dll
new file mode 100644
index 00000000..2fcbd871
--- /dev/null
+++ b/bin/api-ms-win-core-sysinfo-l1-1-0.dll
Binary files differ
diff --git a/bin/api-ms-win-core-timezone-l1-1-0.dll b/bin/api-ms-win-core-timezone-l1-1-0.dll
new file mode 100644
index 00000000..37492726
--- /dev/null
+++ b/bin/api-ms-win-core-timezone-l1-1-0.dll
Binary files differ
diff --git a/bin/api-ms-win-core-util-l1-1-0.dll b/bin/api-ms-win-core-util-l1-1-0.dll
new file mode 100644
index 00000000..536f9c97
--- /dev/null
+++ b/bin/api-ms-win-core-util-l1-1-0.dll
Binary files differ
diff --git a/bin/api-ms-win-crt-conio-l1-1-0.dll b/bin/api-ms-win-crt-conio-l1-1-0.dll
new file mode 100644
index 00000000..a5312bd0
--- /dev/null
+++ b/bin/api-ms-win-crt-conio-l1-1-0.dll
Binary files differ
diff --git a/bin/api-ms-win-crt-convert-l1-1-0.dll b/bin/api-ms-win-crt-convert-l1-1-0.dll
new file mode 100644
index 00000000..d0e8a74f
--- /dev/null
+++ b/bin/api-ms-win-crt-convert-l1-1-0.dll
Binary files differ
diff --git a/bin/api-ms-win-crt-environment-l1-1-0.dll b/bin/api-ms-win-crt-environment-l1-1-0.dll
new file mode 100644
index 00000000..33ab4235
--- /dev/null
+++ b/bin/api-ms-win-crt-environment-l1-1-0.dll
Binary files differ
diff --git a/bin/api-ms-win-crt-filesystem-l1-1-0.dll b/bin/api-ms-win-crt-filesystem-l1-1-0.dll
new file mode 100644
index 00000000..73c1bbd0
--- /dev/null
+++ b/bin/api-ms-win-crt-filesystem-l1-1-0.dll
Binary files differ
diff --git a/bin/api-ms-win-crt-heap-l1-1-0.dll b/bin/api-ms-win-crt-heap-l1-1-0.dll
new file mode 100644
index 00000000..b2491c58
--- /dev/null
+++ b/bin/api-ms-win-crt-heap-l1-1-0.dll
Binary files differ
diff --git a/bin/api-ms-win-crt-locale-l1-1-0.dll b/bin/api-ms-win-crt-locale-l1-1-0.dll
new file mode 100644
index 00000000..5c6daf8b
--- /dev/null
+++ b/bin/api-ms-win-crt-locale-l1-1-0.dll
Binary files differ
diff --git a/bin/api-ms-win-crt-math-l1-1-0.dll b/bin/api-ms-win-crt-math-l1-1-0.dll
new file mode 100644
index 00000000..59f5938e
--- /dev/null
+++ b/bin/api-ms-win-crt-math-l1-1-0.dll
Binary files differ
diff --git a/bin/api-ms-win-crt-multibyte-l1-1-0.dll b/bin/api-ms-win-crt-multibyte-l1-1-0.dll
new file mode 100644
index 00000000..08fde912
--- /dev/null
+++ b/bin/api-ms-win-crt-multibyte-l1-1-0.dll
Binary files differ
diff --git a/bin/api-ms-win-crt-private-l1-1-0.dll b/bin/api-ms-win-crt-private-l1-1-0.dll
new file mode 100644
index 00000000..5504b29b
--- /dev/null
+++ b/bin/api-ms-win-crt-private-l1-1-0.dll
Binary files differ
diff --git a/bin/api-ms-win-crt-process-l1-1-0.dll b/bin/api-ms-win-crt-process-l1-1-0.dll
new file mode 100644
index 00000000..6db6d131
--- /dev/null
+++ b/bin/api-ms-win-crt-process-l1-1-0.dll
Binary files differ
diff --git a/bin/api-ms-win-crt-runtime-l1-1-0.dll b/bin/api-ms-win-crt-runtime-l1-1-0.dll
new file mode 100644
index 00000000..3ccdf40b
--- /dev/null
+++ b/bin/api-ms-win-crt-runtime-l1-1-0.dll
Binary files differ
diff --git a/bin/api-ms-win-crt-stdio-l1-1-0.dll b/bin/api-ms-win-crt-stdio-l1-1-0.dll
new file mode 100644
index 00000000..50e08763
--- /dev/null
+++ b/bin/api-ms-win-crt-stdio-l1-1-0.dll
Binary files differ
diff --git a/bin/api-ms-win-crt-string-l1-1-0.dll b/bin/api-ms-win-crt-string-l1-1-0.dll
new file mode 100644
index 00000000..32a56dbb
--- /dev/null
+++ b/bin/api-ms-win-crt-string-l1-1-0.dll
Binary files differ
diff --git a/bin/api-ms-win-crt-time-l1-1-0.dll b/bin/api-ms-win-crt-time-l1-1-0.dll
new file mode 100644
index 00000000..f5c85a6c
--- /dev/null
+++ b/bin/api-ms-win-crt-time-l1-1-0.dll
Binary files differ
diff --git a/bin/api-ms-win-crt-utility-l1-1-0.dll b/bin/api-ms-win-crt-utility-l1-1-0.dll
new file mode 100644
index 00000000..0dd8c7e9
--- /dev/null
+++ b/bin/api-ms-win-crt-utility-l1-1-0.dll
Binary files differ
diff --git a/bin/ffi.dll b/bin/ffi.dll
new file mode 100644
index 00000000..048b2b0f
--- /dev/null
+++ b/bin/ffi.dll
Binary files differ
diff --git a/bin/filesystem.dll b/bin/filesystem.dll
new file mode 100644
index 00000000..536b3d93
--- /dev/null
+++ b/bin/filesystem.dll
Binary files differ
diff --git a/bin/lpeglabel.dll b/bin/lpeglabel.dll
new file mode 100644
index 00000000..56b76ed4
--- /dev/null
+++ b/bin/lpeglabel.dll
Binary files differ
diff --git a/bin/lua.exe b/bin/lua.exe
new file mode 100644
index 00000000..f72d0632
--- /dev/null
+++ b/bin/lua.exe
Binary files differ
diff --git a/bin/lua53.dll b/bin/lua53.dll
new file mode 100644
index 00000000..a8d1f825
--- /dev/null
+++ b/bin/lua53.dll
Binary files differ
diff --git a/bin/msvcp140.dll b/bin/msvcp140.dll
new file mode 100644
index 00000000..0a30fd08
--- /dev/null
+++ b/bin/msvcp140.dll
Binary files differ
diff --git a/bin/vcruntime140.dll b/bin/vcruntime140.dll
new file mode 100644
index 00000000..fa755e5c
--- /dev/null
+++ b/bin/vcruntime140.dll
Binary files differ
diff --git a/bin/ydbase.dll b/bin/ydbase.dll
new file mode 100644
index 00000000..48fa2abf
--- /dev/null
+++ b/bin/ydbase.dll
Binary files differ
diff --git a/bin/yue.dll b/bin/yue.dll
new file mode 100644
index 00000000..42f015c6
--- /dev/null
+++ b/bin/yue.dll
Binary files differ
diff --git a/src/utility.lua b/src/utility.lua
new file mode 100644
index 00000000..73c65237
--- /dev/null
+++ b/src/utility.lua
@@ -0,0 +1,21 @@
+function io.load(file_path)
+ local f, e = io.open(file_path:string(), 'rb')
+ if not f then
+ return nil, e
+ end
+ local buf = f:read 'a'
+ f:close()
+ return buf
+end
+
+function io.save(file_path, content)
+ local f, e = io.open(file_path:string(), "wb")
+
+ if f then
+ f:write(content)
+ f:close()
+ return true
+ else
+ return false, e
+ end
+end
diff --git a/test/global_protect.lua b/test/global_protect.lua
new file mode 100644
index 00000000..6c736ea6
--- /dev/null
+++ b/test/global_protect.lua
@@ -0,0 +1,10 @@
+local mt = {}
+setmetatable(_G, mt)
+
+function mt:__index(k)
+ error(('读取不存在的全局变量[%s]'):format(k), 2)
+end
+
+function mt:__newindex(k, v)
+ error(('保存全局变量[%s] = [%s]'):format(k, v), 2)
+end
diff --git a/test/main.lua b/test/main.lua
new file mode 100644
index 00000000..d8730f09
--- /dev/null
+++ b/test/main.lua
@@ -0,0 +1,10 @@
+root = arg[0] .. '\\..\\..'
+package.path = package.path .. ';' .. root .. '\\src\\?.lua'
+ .. ';' .. root .. '\\src\\?\\init.lua'
+ .. ';' .. root .. '\\test\\?.lua'
+ .. ';' .. root .. '\\test\\?\\init.lua'
+
+require 'filesystem'
+require 'utility'
+require 'global_protect'
+print('测试')