~ubuntu-branches/debian/squeeze/putty/squeeze

« back to all changes in this revision

Viewing changes to windows/winpgntc.c

  • Committer: Bazaar Package Importer
  • Author(s): Colin Watson
  • Date: 2008-05-28 09:28:32 UTC
  • mfrom: (4.1.4 hardy)
  • Revision ID: james.westby@ubuntu.com-20080528092832-88epkb3d4s1zsw61
Tags: 0.60-3
* Move putty to Applications/Network/Communication menu sub-section.
* Use dh_desktop.

Show diffs side-by-side

added added

removed removed

Lines of Context:
10
10
#define AGENT_COPYDATA_ID 0x804e50ba   /* random goop */
11
11
#define AGENT_MAX_MSGLEN  8192
12
12
 
13
 
#define GET_32BIT(cp) \
14
 
    (((unsigned long)(unsigned char)(cp)[0] << 24) | \
15
 
    ((unsigned long)(unsigned char)(cp)[1] << 16) | \
16
 
    ((unsigned long)(unsigned char)(cp)[2] << 8) | \
17
 
    ((unsigned long)(unsigned char)(cp)[3]))
18
 
 
19
13
int agent_exists(void)
20
14
{
21
15
    HWND hwnd;
91
85
    mapname = dupprintf("PageantRequest%08x", (unsigned)GetCurrentThreadId());
92
86
    filemap = CreateFileMapping(INVALID_HANDLE_VALUE, NULL, PAGE_READWRITE,
93
87
                                0, AGENT_MAX_MSGLEN, mapname);
94
 
    if (!filemap)
 
88
    if (filemap == NULL || filemap == INVALID_HANDLE_VALUE)
95
89
        return 1;                      /* *out == NULL, so failure */
96
90
    p = MapViewOfFile(filemap, FILE_MAP_WRITE, 0, 0, 0);
97
91
    memcpy(p, in, inlen);