~ubuntu-branches/ubuntu/utopic/binkd/utopic-proposed

« back to all changes in this revision

Viewing changes to nt/w32tools.h

  • Committer: Package Import Robot
  • Author(s): Marco d'Itri
  • Date: 2014-07-21 03:18:57 UTC
  • mfrom: (1.2.5)
  • Revision ID: package-import@ubuntu.com-20140721031857-86q9nft3k63gwoki
Tags: 1.0.2-1
* New upstream release. (Closes: #686869)
* binkd.logrotate: use the correct log file. (Closes: #710776)
* Stop checking inetd.conf in the init script. (Closes: #739707)
* Added a systemd unit file.
* Switched /var/log/binkd/ to mode 750.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 *  w32tools.h -- Windows NT specific functions declarations
 
3
 *
 
4
 *  w32tools.h is a part of binkd project
 
5
 *
 
6
 *  Copyright (c) 2003 by Stas Degteff g@grumbler.org 2:5080/102@fidonet
 
7
 *
 
8
 *  This program is free software; you can redistribute it and/or modify
 
9
 *  it under the terms of the GNU General Public License as published by
 
10
 *  the Free Software Foundation; either version 2 of the License, or
 
11
 *  (at your option) any later version. See COPYING.
 
12
 */
 
13
 
 
14
/*
 
15
 * $Id: w32tools.h,v 2.12 2012/01/23 18:10:57 gul Exp $
 
16
 *
 
17
 * Revision history:
 
18
 * $Log: w32tools.h,v $
 
19
 * Revision 2.12  2012/01/23 18:10:57  gul
 
20
 * Fixed declaration of binkd_main() (no 3rd param)
 
21
 *
 
22
 * Revision 2.11  2004/01/04 16:55:00  stas
 
23
 * Move declarations of the 'binkd_main' into one place (nt/w32tools.h)
 
24
 *
 
25
 * Revision 2.10  2004/01/03 19:04:20  stas
 
26
 * New functions: public w32Init() and hidden w32exitfunc()
 
27
 *
 
28
 * Revision 2.9  2004/01/03 18:14:41  stas
 
29
 * Two macroses: IsNTService and Is9xService
 
30
 *
 
31
 * Revision 2.8  2004/01/03 12:17:44  stas
 
32
 * Implement full icon support (winNT/2k/XP)
 
33
 *
 
34
 * Revision 2.7  2004/01/02 21:20:17  stas
 
35
 * GetMainWindow(): function retrieves the window handle used by the main window of application
 
36
 *
 
37
 * Revision 2.6  2003/10/28 20:20:10  stas
 
38
 * Rewrite NT service code, remove obsoleted code and add some checks. Found a thread-not-safety problem.
 
39
 *
 
40
 * Revision 2.5  2003/10/18 18:50:48  stas
 
41
 * Move to new 'tray.c' file several functions when is related with 'minimize to tray' feature
 
42
 *
 
43
 * Revision 2.4  2003/08/21 15:40:35  gul
 
44
 * Change building commandline for service under win32
 
45
 * (patch by Alexander Reznikov)
 
46
 *
 
47
 * Revision 2.3  2003/08/04 12:23:40  gul
 
48
 * Add CVS tags
 
49
 *
 
50
 */
 
51
 
 
52
#ifndef __W32TOOLS_H
 
53
#define __W32TOOLS_H
 
54
 
 
55
#define AlertWin(text) MessageBox(NULL, text, MYNAME, MB_OK|MB_ICONSTOP|0x00200000L|MB_SYSTEMMODAL|MB_SETFOREGROUND)
 
56
 
 
57
/* Declaration of main binkd function (see binkd.c) */
 
58
int binkd_main(int argc, char **argv);
 
59
 
 
60
#define IsNTService (IsNT()&&isService())
 
61
#define Is9xService (Is9x()&&isService())
 
62
 
 
63
/* Test on Windows 95/98/Me
 
64
   Return 0 if not match
 
65
   (This is call to W32_CheckOS())
 
66
*/
 
67
int Is9x();
 
68
 
 
69
/* Test on Windows NT/2000/XP/2003
 
70
   Return 0 if not match
 
71
   (This is call to W32_CheckOS())
 
72
*/
 
73
int IsNT();
 
74
 
 
75
/* Windows version test
 
76
 * Parameter: Platform ID (VER_PLATFORM_WIN32_NT, VER_PLATFORM_WIN32_WINDOWS
 
77
 *            or other, see GetVersionEx() if MSDN)
 
78
 * Return 0 if match OS, not zero (usually -1) if do not match OS,
 
79
 * return 1 if can't retrieve OS version info.
 
80
 */
 
81
int W32_CheckOS(unsigned long PlatformId);
 
82
 
 
83
/* Return service name (retrieve from installed service or replace spaces with underscores)
 
84
   Parameter is "service display name"
 
85
   Based on get_service_name() from Apache sources (c) The Apache Software Foundation.
 
86
*/
 
87
char *get_service_name(char *display_name);
 
88
 
 
89
/* Build service arguments list
 
90
 * Parameters:  asp       - new arguments list
 
91
 *              argv      - old arguments list in *argv[] format
 
92
 *              use_argv0 - use argv[0] or GetModuleFileName()
 
93
 * Function add two '\0' to indicate end of array.
 
94
 * Return asp size.
 
95
 */
 
96
int build_service_arguments(char **asp, char *argv[], int use_argv0);
 
97
 
 
98
 
 
99
/**************************************************************************
 
100
 * Determine if we're running as a service. Return 0 if binkd running not *
 
101
 * as a service. Universal: any 32-bit version of Windows.                *
 
102
 *                                                                        *
 
103
 * Windows NT/2000/XP/2003: a hack to determine if we're running          *
 
104
 * as a service without waiting for the SCM to fail.                      *
 
105
 * (Idea taken from Apache sources)                                       *
 
106
 * Windows 9x/Me: service indicated via undocumented command line option  *
 
107
 */
 
108
int isService();
 
109
 
 
110
/**************************************************************************
 
111
 * The GetMainWindow function retrieves the window handle used by the main
 
112
 * window.
 
113
 */
 
114
HWND GetMainWindow(void);
 
115
 
 
116
/* Load the icon
 
117
 */
 
118
HICON LoadBinkdIcon(void);
 
119
 
 
120
/* Unload the icon
 
121
 */
 
122
void UnloadBinkdIcon(void);
 
123
 
 
124
/* Startup actions for win32 and win9x versions of binkd
 
125
 */
 
126
void w32Init(void);
 
127
 
 
128
#endif