svn rev #25338: trunk/src/windows/leash/

hartmans@MIT.EDU hartmans at MIT.EDU
Fri Oct 14 10:40:36 EDT 2011


http://src.mit.edu/fisheye/changelog/krb5/?cs=25338
Commit By: hartmans
Log Message:
Fixed some warnings and Windows 64 portability issues in the leash executable

Signed-off-by: Alexey Melnikov <aamelnikov at gmail.com>


Changed Files:
U   trunk/src/windows/leash/CLeashDragListBox.cpp
U   trunk/src/windows/leash/Leash.cpp
U   trunk/src/windows/leash/LeashMessageBox.cpp
U   trunk/src/windows/leash/LeashMessageBox.h
U   trunk/src/windows/leash/LeashView.cpp
U   trunk/src/windows/leash/LeashView.h
Modified: trunk/src/windows/leash/CLeashDragListBox.cpp
===================================================================
--- trunk/src/windows/leash/CLeashDragListBox.cpp	2011-10-14 14:40:32 UTC (rev 25337)
+++ trunk/src/windows/leash/CLeashDragListBox.cpp	2011-10-14 14:40:36 UTC (rev 25338)
@@ -66,7 +66,7 @@
 	if (nDestIndex == nSrcIndex || nDestIndex == nSrcIndex+1)
 		return; //didn't move
 	CString str1, str2;
-	DWORD dwData;
+	DWORD_PTR dwData;
 	GetText(nSrcIndex, str1);
 	GetText(nDestIndex, str2);
 	dwData = GetItemData(nSrcIndex);

Modified: trunk/src/windows/leash/Leash.cpp
===================================================================
--- trunk/src/windows/leash/Leash.cpp	2011-10-14 14:40:32 UTC (rev 25337)
+++ trunk/src/windows/leash/Leash.cpp	2011-10-14 14:40:36 UTC (rev 25338)
@@ -37,6 +37,8 @@
 
 #include <errno.h>
 
+#include <afxwin.h>
+
 #ifdef _DEBUG
 #define new DEBUG_NEW
 #undef THIS_FILE
@@ -191,9 +193,9 @@
                 0 == stricmp(optionParam+1, "i"))
             {
                 LSH_DLGINFO_EX ldi;
-				char username[64]="";
-				char realm[192]="";
-				int i=0, j=0;
+		char username[64]="";
+		char realm[192]="";
+		int i=0, j=0;
                 TicketList* ticketList = NULL;
                 if (WaitForSingleObject( ticketinfo.lockObj, INFINITE ) != WAIT_OBJECT_0)
                     throw("Unable to lock ticketinfo");
@@ -947,7 +949,7 @@
                 }
 
                 char realmkey[256]="SYSTEM\\CurrentControlSet\\Control\\Lsa\\Kerberos\\Domains\\";
-                int  keylen = strlen(realmkey)-1;
+                size_t  keylen = strlen(realmkey)-1;
 
                 if ( domain[0] ) {
                     strncpy(realm,domain,256);

Modified: trunk/src/windows/leash/LeashMessageBox.cpp
===================================================================
--- trunk/src/windows/leash/LeashMessageBox.cpp	2011-10-14 14:40:32 UTC (rev 25337)
+++ trunk/src/windows/leash/LeashMessageBox.cpp	2011-10-14 14:40:36 UTC (rev 25338)
@@ -61,7 +61,7 @@
 /////////////////////////////////////////////////////////////////////////////
 // CLeashMessageBox message handlers
 
-void CALLBACK CLeashMessageBox::MessageBoxTimer(HWND hwnd, UINT uiMsg, UINT idEvent, DWORD dwTime)
+void CALLBACK CLeashMessageBox::MessageBoxTimer(HWND hwnd, UINT uiMsg, UINT_PTR idEvent, DWORD dwTime)
 {
 	::KillTimer(hwnd, 2);
 	::SendMessage(hwnd, WM_CLOSE, 0, 0);
@@ -76,7 +76,7 @@
 BOOL CLeashMessageBox::OnInitDialog()
 {
 	CDialog::OnInitDialog();
-	UINT idTimer = SetTimer(2, m_dwTime, (TIMERPROC)MessageBoxTimer);
+	UINT_PTR idTimer = SetTimer(2, m_dwTime, &MessageBoxTimer);
 
 	return TRUE;  // return TRUE unless you set the focus to a control
 	              // EXCEPTION: OCX Property Pages should return FALSE

Modified: trunk/src/windows/leash/LeashMessageBox.h
===================================================================
--- trunk/src/windows/leash/LeashMessageBox.h	2011-10-14 14:40:32 UTC (rev 25337)
+++ trunk/src/windows/leash/LeashMessageBox.h	2011-10-14 14:40:36 UTC (rev 25338)
@@ -31,7 +31,7 @@
 {
 private:
 	static DWORD m_dwTime;
-	static void CALLBACK MessageBoxTimer(HWND hwnd, UINT uiMsg, UINT idEvent, DWORD dwTime);
+	static void CALLBACK MessageBoxTimer(HWND hwnd, UINT uiMsg, UINT_PTR idEvent, DWORD dwTime);
 
 	// Construction
 public:

Modified: trunk/src/windows/leash/LeashView.cpp
===================================================================
--- trunk/src/windows/leash/LeashView.cpp	2011-10-14 14:40:32 UTC (rev 25337)
+++ trunk/src/windows/leash/LeashView.cpp	2011-10-14 14:40:36 UTC (rev 25338)
@@ -96,7 +96,7 @@
 END_MESSAGE_MAP()
 
 
-LONG CLeashView::m_ticketTimeLeft = 0;  // # of seconds left before tickets expire
+time_t CLeashView::m_ticketTimeLeft = 0;  // # of seconds left before tickets expire
 INT  CLeashView::m_forwardableTicket = 0;
 INT  CLeashView::m_proxiableTicket = 0;
 INT  CLeashView::m_renewableTicket = 0;
@@ -242,7 +242,7 @@
     printf("OnClose\n");
 }
 
-LONG CLeashView::LeashTime()
+time_t CLeashView::LeashTime()
 {
     _tzset();
     return time(0);
@@ -285,7 +285,7 @@
 
 
 VOID CALLBACK EXPORT CLeashView::TimerProc(HWND hWnd, UINT nMsg,
-                                           UINT nIDEvent, DWORD dwTime)
+                                           UINT_PTR nIDEvent, DWORD dwTime)
 {
     // All of the work is being done in the PreTranslateMessage method
     // in order to have access to the object

Modified: trunk/src/windows/leash/LeashView.h
===================================================================
--- trunk/src/windows/leash/LeashView.h	2011-10-14 14:40:32 UTC (rev 25337)
+++ trunk/src/windows/leash/LeashView.h	2011-10-14 14:40:36 UTC (rev 25338)
@@ -114,8 +114,8 @@
     static INT			m_warningOfTicketTimeLeftLockKrb5;
     static INT			m_updateDisplayCount;
     static INT	        m_alreadyPlayedDisplayCount;
-    static LONG			m_ticketTimeLeft;
-	static BOOL			m_lowTicketAlarmSound;
+    static time_t		m_ticketTimeLeft;
+    static BOOL			m_lowTicketAlarmSound;
     static LONG         m_timerMsgNotInProgress;
 
 	VOID ResetTreeNodes();
@@ -130,19 +130,19 @@
     //void   GetRowWidthHeight(CDC* pDC, LPCSTR theString, int& nRowWidth,
     //                         int& nRowHeight, int& nCharWidth);
     static VOID	AlarmBeep();
-	static VOID	CALLBACK EXPORT TimerProc(HWND hWnd, UINT nMsg, UINT nIDEvent,
-                                          DWORD dwTime);
-	static VOID	UpdateTicketTime(TICKETINFO& ticketinfo);
-	static INT	GetLowTicketStatus(int);
-	static LONG	LeashTime();
+    static VOID	CALLBACK EXPORT TimerProc(HWND hWnd, UINT nMsg, UINT_PTR nIDEvent,
+					  DWORD dwTime);
+    static VOID	UpdateTicketTime(TICKETINFO& ticketinfo);
+    static INT	GetLowTicketStatus(int);
+    static time_t	LeashTime();
 
     void   SetTrayIcon(int nim, int state=0);
     void   SetTrayText(int nim, CString tip);
 
     BOOL   UpdateDisplay();
     static UINT InitTicket(void *);
-	static UINT RenewTicket(void *);
-	static UINT ImportTicket(void *);
+    static UINT RenewTicket(void *);
+    static UINT ImportTicket(void *);
 
 protected: // create from serialization only
 	DECLARE_DYNCREATE(CLeashView)




More information about the cvs-krb5 mailing list