~ubuntu-branches/ubuntu/precise/krb5/precise-updates

« back to all changes in this revision

Viewing changes to src/windows/leash/VSroutines.c

  • Committer: Package Import Robot
  • Author(s): Sam Hartman
  • Date: 2011-12-01 19:34:41 UTC
  • mfrom: (28.1.14 sid)
  • Revision ID: package-import@ubuntu.com-20111201193441-9tipg3aru1jsidyv
Tags: 1.10+dfsg~alpha1-6
* Fix segfault with unknown hostnames in krb5_sname_to_principal,
  Closes: #650671
* Indicate that this library breaks libsmbclient versions that depend on
  krb5_locate_kdc, Closes: #650603, #650611

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#include <windows.h>
 
2
#include <winver.h>
 
3
 
 
4
#if 0
 
5
//#ifdef USE_VS
 
6
#include <vs.h>
 
7
 
 
8
#define ININAME "leash.ini"
 
9
 
 
10
int VScheckVersion(HWND hWnd, HANDLE hThisInstance)
 
11
{
 
12
    VS_Request          vrequest;
 
13
    VS_Status           status;
 
14
    BOOL                ok_to_continue;
 
15
    HCURSOR             hcursor;
 
16
    char                szFilename[255];
 
17
    char                szVerQ[90];
 
18
    char                *cp;
 
19
    LPSTR               lpAppVersion;
 
20
    LPSTR               lpAppName;
 
21
    LONG FAR            *lpLangInfo;
 
22
    DWORD               hVersionInfoID;
 
23
    DWORD               size;
 
24
    GLOBALHANDLE        hVersionInfo;
 
25
    LPSTR               lpVersionInfo;
 
26
    int                 dumint;
 
27
    int                 retval;
 
28
 
 
29
    GetModuleFileName(hThisInstance, (LPSTR)szFilename, 255);
 
30
    size = GetFileVersionInfoSize((LPSTR) szFilename, &hVersionInfoID);
 
31
    hVersionInfo = GlobalAlloc(GHND, size);
 
32
    lpVersionInfo = GlobalLock(hVersionInfo);
 
33
    retval = GetFileVersionInfo(szFilename, hVersionInfoID, size,
 
34
                                lpVersionInfo);
 
35
    retval = VerQueryValue(lpVersionInfo, "\\VarFileInfo\\Translation",
 
36
                           (LPSTR FAR *)&lpLangInfo, &dumint);
 
37
    wsprintf(szVerQ, "\\StringFileInfo\\%04x%04x\\",
 
38
             LOWORD(*lpLangInfo), HIWORD(*lpLangInfo));
 
39
    cp = szVerQ + lstrlen(szVerQ);
 
40
    lstrcpy(cp, "ProductName");
 
41
    retval = VerQueryValue(lpVersionInfo, szVerQ, &lpAppName, &dumint);
 
42
    lstrcpy(cp, "ProductVersion");
 
43
 
 
44
    retval = VerQueryValue(lpVersionInfo, szVerQ, &lpAppVersion, &dumint);
 
45
    hcursor = SetCursor(LoadCursor((HINSTANCE)NULL, IDC_WAIT));
 
46
    vrequest = VSFormRequest(lpAppName, lpAppVersion, ININAME, NULL, hWnd,
 
47
                             V_CHECK_AND_LOG);
 
48
    if ((ok_to_continue = (ReqStatus(vrequest) != V_E_CANCEL))
 
49
        && v_complain((status = VSProcessRequest(vrequest)), ININAME))
 
50
        WinVSReportRequest(vrequest, hWnd, "Version Server Status Report");
 
51
    if (ok_to_continue && status == V_REQUIRED)
 
52
        ok_to_continue = FALSE;
 
53
    VSDestroyRequest(vrequest);
 
54
    SetCursor(hcursor);
 
55
    GlobalUnlock(hVersionInfo);
 
56
    GlobalFree(hVersionInfo);
 
57
    return(ok_to_continue);
 
58
}
 
59
#else
 
60
int VScheckVersion(HWND hWnd, HANDLE hThisInstance)
 
61
{
 
62
    return(1);
 
63
}
 
64
#endif