![]() |
udefrag.dll Architecture - Reference Manual - Guides |
|
00001 /* 00002 * UltraDefrag - powerful defragmentation tool for Windows NT. 00003 * Copyright (c) 2007-2010 by Dmitri Arkhangelski (dmitriar@gmail.com). 00004 * 00005 * This program is free software; you can redistribute it and/or modify 00006 * it under the terms of the GNU General Public License as published by 00007 * the Free Software Foundation; either version 2 of the License, or 00008 * (at your option) any later version. 00009 * 00010 * This program is distributed in the hope that it will be useful, 00011 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00012 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00013 * GNU General Public License for more details. 00014 * 00015 * You should have received a copy of the GNU General Public License 00016 * along with this program; if not, write to the Free Software 00017 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 00018 */ 00019 00027 #include "../../include/ntndk.h" 00028 00029 #include "../../include/udefrag.h" 00030 #include "../zenwinx/zenwinx.h" 00031 00032 /* 00033 * http://sourceforge.net/tracker/index.php?func= 00034 * detail&aid=2886353&group_id=199532&atid=969873 00035 */ 00036 ULONGLONG time_limit = 0; 00037 int refresh_interval = DEFAULT_REFRESH_INTERVAL; 00038 00043 void udefrag_reload_settings(void) 00044 { 00045 #define ENV_BUFFER_LENGTH 128 00046 short env_buffer[ENV_BUFFER_LENGTH]; 00047 char buf[ENV_BUFFER_LENGTH]; 00048 ULONGLONG i; 00049 00050 /* reset all parameters */ 00051 refresh_interval = DEFAULT_REFRESH_INTERVAL; 00052 time_limit = 0; 00053 00054 if(winx_query_env_variable(L"UD_TIME_LIMIT",env_buffer,ENV_BUFFER_LENGTH) >= 0){ 00055 (void)_snprintf(buf,ENV_BUFFER_LENGTH - 1,"%ws",env_buffer); 00056 buf[ENV_BUFFER_LENGTH - 1] = 0; 00057 time_limit = winx_str2time(buf); 00058 } 00059 DebugPrint("Time limit = %I64u seconds\n",time_limit); 00060 00061 if(winx_query_env_variable(L"UD_REFRESH_INTERVAL",env_buffer,ENV_BUFFER_LENGTH) >= 0) 00062 refresh_interval = _wtoi(env_buffer); 00063 DebugPrint("Refresh interval = %u msec\n",refresh_interval); 00064 00065 (void)strcpy(buf,""); 00066 (void)winx_dfbsize(buf,&i); /* to force MinGW export udefrag_dfbsize */ 00067 (void)i; 00068 } 00069