HSP3からはdirinfo関数を使用することでシステムディレクトリのパスを取得できますが、 HSP2以前は存在しないため、取得するにはAPI関数GetSystemDirectoryを呼び出す必要があります。 尚、システムディレクトリとは、Windowsフォルダ内の「system」フォルダのことではなく、 Windowsフォルダ内の「system32」フォルダのことです。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
ll_libload kernel, "kernel32.dll" ll_getproc GetSystemDirectory, "GetSystemDirectoryA", kernel #module #deffunc getsysdir mref rstr, 65 ll_getptr rstr : ll_ret prm prm.1 = 256 ll_callfunc prm, 2, GetSystemDirectory@ return #global getsysdir mes "システムフォルダのパスは「" + refstr + "」です" stop