summaryrefslogtreecommitdiff
path: root/plugins/MirLua/Modules/WinAPI
diff options
context:
space:
mode:
authorMikalaiR <nikolay.romanovich@narod.ru>2016-01-24 10:48:07 +0000
committerMikalaiR <nikolay.romanovich@narod.ru>2016-01-24 10:48:07 +0000
commitce2a12e067554fc270e7d4f54302bf41c2310fc8 (patch)
tree78d18b55c277b16c14fb754ed659bb7f1d720dcf /plugins/MirLua/Modules/WinAPI
parent02f6da6423c057f4fc4f2c60aa4bd1ce79418015 (diff)
Mirlua: CopyFile winapi function
git-svn-id: http://svn.miranda-ng.org/main/trunk@16162 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/MirLua/Modules/WinAPI')
-rw-r--r--plugins/MirLua/Modules/WinAPI/src/winapi.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/plugins/MirLua/Modules/WinAPI/src/winapi.cpp b/plugins/MirLua/Modules/WinAPI/src/winapi.cpp
index 28456f2013..974010d7b6 100644
--- a/plugins/MirLua/Modules/WinAPI/src/winapi.cpp
+++ b/plugins/MirLua/Modules/WinAPI/src/winapi.cpp
@@ -1037,6 +1037,17 @@ static int global_DeleteFile(lua_State *L)
return 1;
}
+static int global_CopyFile(lua_State *L)
+{
+ LPCSTR szFrom = luaL_checkstring(L, 1);
+ LPCSTR szTo = luaL_checkstring(L, 2);
+ BOOL bError = luaL_optnumber(L, 3, 0);
+
+ BOOL res = CopyFileA(szFrom, szTo, bError);
+ lua_pushboolean(L, res);
+ return 1;
+}
+
static int global_WaitForSingleObject(lua_State *L) {
HANDLE h = (HANDLE)(intptr_t)luaL_checknumber(L, 1);
DWORD t = (DWORD)luaL_checknumber(L, 2);
@@ -1910,6 +1921,7 @@ static luaL_Reg winApi[] =
{ "ReadFile", global_ReadFile },
{ "WriteFile", global_WriteFile },
{ "DeleteFile", global_DeleteFile },
+ { "CopyFile", global_CopyFile },
{ "TerminateProcess", global_TerminateProcess },
{ "GetExitCodeProcess", global_GetExitCodeProcess },
{ "WaitForSingleObject", global_WaitForSingleObject },