On 10/05/2010 03:16 PM, Kern Sibbald wrote:
> Hello Avi,
>
> I have now added the code that you sent me, but the problem is that we use 
> mingw and they do not have definitions for SetThreadExecutionState or the 
> EXECUTIO_STATE variable.  

This is funny. I've made it a point of searching for these in the
mingw32-runtime [1] files on my Debian box, before I sent in the patch.

> I did a quick look up on MSN but didn't find what I 
> need, could you send me some information on how those are defined 

See attached output of grep.



> -- we do 
> not directly use windows.h because it is "proprietary".
>   

Well, I'm not qualified to comment on that - I'm just an engineer :-)

Cheers,
Avi


[1] http://packages.debian.org/squeeze/mingw32-runtime

> Best regards,
>
> Kern
>
> On Friday 01 October 2010 16:12:42 Avi Rozen wrote:
>   
>> On 10/01/2010 02:29 PM, Kern Sibbald wrote:
>>     
>>> Hello,
>>>
>>> Thanks for the pointers to the Windows documentation and the sample
>>> Python program.  I wasn't aware that this is a problem, but from the
>>> Windows documentation, it looks relatively simple to fix (i.e. integrate
>>> into the FD).
>>>       
>> I've attached an *untested* patch against current git. It should work (TM).
>>
>>     
>>> Building the Windows binaries is done by cross compiling.  It is
>>> documented in detail in <bacula>/src/win32/README.mingw
>>>       
>> Read it, and it does look like too much of a hassle at this point.
>>
>> I should add that an integrated per-client wake-on-lan feature would
>> also be useful (I'm currently using a RunBeforeJob directive to wakeup
>> the laptop with sudo+etherwake).
>>
>> Cheers,
>> Avi.
>>
>>     
>>> However, it is not easy to setup
>>> a complete environment and might possibly take much longer to help you
>>> get setup rather than simply implementing it ourselves ...  That said, if
>>> you want to try to build it just read the above referrenced instructions
>>> -- there are at least 6 people aside from myself who have succeeded in
>>> getting it working.
>>>
>>> I will ensure that this is put on our list of items to do for the next
>>> version.
>>>
>>> Thanks again for your pointers.
>>>
>>> Kern
>>>
>>> On Friday 01 October 2010 14:02:23 Avi Rozen wrote:
>>>       
>>>> On 10/01/2010 09:13 AM, Philipp Storz wrote:
>>>>         
>>>>> Hello list,
>>>>>
>>>>> when backing up a windows 7 laptop, I experienced that
>>>>> on the long running full backup, it started to hibernate
>>>>> and so it interrupted the backup.
>>>>>
>>>>> I thought that maybe there is a mechanism to tell windows
>>>>> "hey, I am busy making a backup, please do not fall asleep"
>>>>>
>>>>> Do you think that this is possible, and would it be a good
>>>>> enhancement to the file daemon?
>>>>>
>>>>>
>>>>> Best regards,
>>>>>
>>>>> Philipp
>>>>>           
>>>> The file daemon should use SetThreadExecutionState [1] to enable/disable
>>>> sleeping during backup.
>>>>
>>>> At the moment, however, I'm using an external Python (w/ Cygwin) script
>>>> to do the same via the ClientRunBeforeJob/ClientRunAfterJob directives
>>>> (see attached scripts).
>>>>
>>>> IMHO this should be integrated into the file daemon.
>>>>
>>>> I'm willing to write a patch for this, but I need some pointers (build
>>>> instructions for 64bit would be a good start - I couldn't find this with
>>>> a casual search through the manual).
>>>>
>>>> Avi
>>>>
>>>>
>>>> [1] http://msdn.microsoft.com/en-us/library/aa373208%28v=vs.85%29.aspx
>>>>
>>>>         
>>>>> -----------------------------------------------------------------------
>>>>> -- ----- Start uncovering the many advantages of virtual appliances and
>>>>> start using them to simplify application deployment and
>>>>> accelerate your shift to cloud computing.
>>>>> http://p.sf.net/sfu/novell-sfdev2dev
>>>>> _______________________________________________
>>>>> Bacula-devel mailing list
>>>>> [email protected]
>>>>> https://lists.sourceforge.net/lists/listinfo/bacula-devel
>>>>>           
>
>   

$ grep -n -C 3 EXECUTION_STATE /usr/i586-mingw32msvc/include/*
/usr/i586-mingw32msvc/include/winbase.h-1056-} COMPUTER_NAME_FORMAT;
/usr/i586-mingw32msvc/include/winbase.h-1057-#endif
/usr/i586-mingw32msvc/include/winbase.h-1058-#if (_WIN32_WINNT >= 0x0500 || 
_WIN32_WINDOWS >= 0x0410)
/usr/i586-mingw32msvc/include/winbase.h:1059:typedef DWORD EXECUTION_STATE;
/usr/i586-mingw32msvc/include/winbase.h-1060-#endif
/usr/i586-mingw32msvc/include/winbase.h-1061-
/usr/i586-mingw32msvc/include/winbase.h-1062-typedef DWORD(WINAPI 
*LPPROGRESS_ROUTINE)(LARGE_INTEGER,LARGE_INTEGER,LARGE_INTEGER,LARGE_INTEGER,DWORD,DWORD,HANDLE,HANDLE,LPVOID);
--
/usr/i586-mingw32msvc/include/winbase.h-1938-WINBASEAPI DWORD WINAPI 
SetThreadAffinityMask(HANDLE,DWORD);
/usr/i586-mingw32msvc/include/winbase.h-1939-WINBASEAPI BOOL WINAPI 
SetThreadContext(HANDLE,const CONTEXT*);
/usr/i586-mingw32msvc/include/winbase.h-1940-#if (_WIN32_WINNT >= 0x0500 || 
_WIN32_WINDOWS >= 0x0410)
/usr/i586-mingw32msvc/include/winbase.h:1941:WINBASEAPI EXECUTION_STATE WINAPI 
SetThreadExecutionState(EXECUTION_STATE);
/usr/i586-mingw32msvc/include/winbase.h-1942-#endif
/usr/i586-mingw32msvc/include/winbase.h-1943-WINBASEAPI DWORD WINAPI 
SetThreadIdealProcessor(HANDLE,DWORD);
/usr/i586-mingw32msvc/include/winbase.h-1944-WINBASEAPI BOOL WINAPI 
SetThreadPriority(HANDLE,int);

$ grep -n -C 3 ES_SYSTEM_REQUIRED /usr/i586-mingw32msvc/include/*
/usr/i586-mingw32msvc/include/winnt.h-3512-#if 1 /* (WINVER >= 0x0500) */
/usr/i586-mingw32msvc/include/winnt.h-3513-#include <pshpack4.h>
/usr/i586-mingw32msvc/include/winnt.h-3514-
/usr/i586-mingw32msvc/include/winnt.h:3515:#define ES_SYSTEM_REQUIRED           
     0x00000001
/usr/i586-mingw32msvc/include/winnt.h-3516-#define ES_DISPLAY_REQUIRED          
     0x00000002
/usr/i586-mingw32msvc/include/winnt.h-3517-#define ES_USER_PRESENT              
     0x00000004
/usr/i586-mingw32msvc/include/winnt.h-3518-#define ES_CONTINUOUS                
     0x80000000

Attachment: signature.asc
Description: OpenPGP digital signature

------------------------------------------------------------------------------
Beautiful is writing same markup. Internet Explorer 9 supports
standards for HTML5, CSS3, SVG 1.1,  ECMAScript5, and DOM L2 & L3.
Spend less time writing and  rewriting code and more time creating great
experiences on the web. Be a part of the beta today.
http://p.sf.net/sfu/beautyoftheweb
_______________________________________________
Bacula-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bacula-devel

Reply via email to