View Poll Results: Level of Education.

Voters
342. You may not vote on this poll
  • Grade School

    9 2.63%
  • GED / Certifications

    21 6.14%
  • High School

    88 25.73%
  • Associate

    74 21.64%
  • Bachelor

    107 31.29%
  • Master

    27 7.89%
  • Doctorate

    16 4.68%
Page 6 of 9 FirstFirst ... 4 5 6 7 8 ... LastLast
Results 101 to 120 of 178

Thread: Your education level.     submit to reddit submit to twitter

  1. #101
    Chram
    Join Date
    Jun 2006
    Posts
    2,539
    BG Level
    7

    Quote Originally Posted by aurik
    WOW A DEBUGGER YOU'RE SO ELITE

    You realize that dev manuals ARE essentially digested information?
    What else the fuck do you want? The nearly 1000 combinations of bits you can form for a single ADD instruction weren't digested enough for me I guess so I wrote a tool using skills I gained from Google to "digest" it for my weak mind.

    It is a little more than just a debugger though.. I can click on any memory address and change it, change registers that the program can't even touch, flip a flag by clicking on the checkmark, assemble instructions at whatever memory address I want, and I can make hot points to switch between memory addresses at will.

    The main memory area is nice and fast and responds to scrolling the mouse up and down

    The program is written in Java and the client is a C program that runs on FreeBSD which means I can debug programs running on machines besides my own.


    --------


    Quote Originally Posted by divisortheory
    Indeed. Good luck
    Took forever to download MSVC, its SP, and the SDK but it only took me a few min to get a basic service running thanks to http://www.muukka.net/programming/service.html http://www.commsoft.com/services.html and http://msdn.microsoft.com/library/defau ... sample.htm

    http://img380.imageshack.us/img380/644/snapshot3nd7.png

    It is kind of cute.. it beeps every 5 seconds but doesn't spawn the window as the other user yet. I think CreateProcessAsUser is the way to go but it seems services are under some weird security restrictions because they start running before a user even logs in so it might be tricky. I am from a unix background and not a windows one so I gotta learn this stuff from scratch. http://msdn2.microsoft.com/en-us/library/ms682429.aspx seems to be what I need to do though.

    Anyway, going for a jog than going to bed for now. Will finish tomorrow.

  2. #102
    Yoshi P
    Join Date
    Jul 2005
    Posts
    5,016
    BG Level
    8

    Doing good so far. 15% of the way there

  3. #103
    E. Body
    Join Date
    May 2006
    Posts
    2,255
    BG Level
    7

    who's the smart ass that voted grade school

  4. #104
    Relic Horn
    Join Date
    Mar 2006
    Posts
    3,215
    BG Level
    7

    Have you guys really been arguing about the same thing for 4 pages? Now that's focus!

    (Bachelors in CS, graduated last year)

  5. #105
    Cerberus
    Join Date
    Jun 2005
    Posts
    427
    BG Level
    4

    You can prolly Google (and Wiki) enough knowledge to pass yourself off as anything at a bar to pick up chicks. Even if you somehow made it past the interview (assuming you faked experience) then I think you would eventually be exposed if you worked in a job that required specialized training. Especially if your response to every question is "lemme get back to you in two hours." :wink:

    I swear that some people I have worked with faked their way into their jobs. I can tell which people have been formally trained and which people have just on-the-job experience.

    But having a degree is more than just the training. It shows employers that you can take on a difficult, long term commitment and see it through to the end. Which leads me to:

    Congratulations on graduating! 8)

  6. #106
    Banned.

    Join Date
    Jun 2006
    Posts
    2,461
    BG Level
    7

    Undergrad in actuarial science
    MBA, hope to finish in a year or 2

  7. #107
    Chram
    Join Date
    Jun 2006
    Posts
    2,539
    BG Level
    7

    Can't sleep.. clowns will eat me.

    Google brought me http://odetocode.com/Blogs/scott/archiv ... 8/602.aspx showed me
    http://win32.mvps.org/index.html which I cut and paste in the service code from earlier which gives you this.

    Behold the power of google and copy and paste That was less than 4 hours including the time to download MSVC and go for a 30 min jog in between. You run the service with the install command to register the service.. than hit start and whatever you define as command will run by the user you defined.

    Code:
    #include <windows.h>
    #include <tchar.h>
    #include <stdio.h>
    
    #pragma hdrstop
    
    TCHAR* serviceName = TEXT("Hello World Service");
    SERVICE_STATUS serviceStatus;
    SERVICE_STATUS_HANDLE serviceStatusHandle = 0;
    HANDLE stopServiceEvent = 0;
    
    static BOOL
    getAndAllocateLogonSid(
    	HANDLE hToken,
    	PSID *pLogonSid
    )
    {
    	PTOKEN_GROUPS	ptgGroups = NULL;
    	DWORD			cbBuffer  = 0;  	/* allocation size */
    	DWORD			dwSidLength;		/* required size to hold Sid */
    	UINT			i;					/* Sid index counter */
    	BOOL			bSuccess  = FALSE;	/* assume this function will fail */
    
    	*pLogonSid = NULL; // invalidate pointer
    
    	/*
    	** Get neccessary memory allocation
    	*/
    	GetTokenInformation(hToken, TokenGroups, ptgGroups, cbBuffer, &cbBuffer);
    
    	if (cbBuffer)
    		ptgGroups = (PTOKEN_GROUPS)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, cbBuffer);
    
    	/*
    	**	Get Sids for all groups the user belongs to
    	*/
    	bSuccess = GetTokenInformation(
    					hToken,
    					TokenGroups,
    					ptgGroups,
    					cbBuffer,
    					&cbBuffer
    				);
    	if (bSuccess == FALSE)
    		goto finish3;
    
    	/*
    	** Get the logon Sid by looping through the Sids in the token
    	*/
    	for(i = 0 ; i < ptgGroups->GroupCount ; i++)
    	{
    		if (ptgGroups->Groups[i].Attributes & SE_GROUP_LOGON_ID)
    		{
    			/*
    			** insure we are dealing with a valid Sid
    			*/
    			bSuccess = IsValidSid(ptgGroups->Groups[i].Sid);
    			if (bSuccess == FALSE)
    				goto finish3;
    
    			/*
    			** get required allocation size to copy the Sid
    			*/
    			dwSidLength=GetLengthSid(ptgGroups->Groups[i].Sid);
    
    			/*
    			** allocate storage for the Logon Sid
    			*/
    			if(
    				(*pLogonSid = (PSID)HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, dwSidLength))
    				==
    				NULL
    			)
    			{
    				bSuccess = FALSE;
    				goto finish3;
    			}
    
    			/*
    			** copy the Logon Sid to the storage we just allocated
    			*/
    			bSuccess = CopySid(
    							dwSidLength,
    							*pLogonSid,
    							ptgGroups->Groups[i].Sid
    						);
    
    			break;
    		}
    	}
    
    
    finish3:
    	/*
    	** free allocated resources
    	*/
    	if (bSuccess == FALSE)
    	{
    		if(*pLogonSid != NULL)
    		{
    			HeapFree(GetProcessHeap(), 0, *pLogonSid);
    			*pLogonSid = NULL;
    		}
    	}
    
    	if (ptgGroups != NULL)
    		HeapFree(GetProcessHeap(), 0, ptgGroups);
    
    	return bSuccess;
    }
     
     
    static BOOL
    setSidOnAcl(
    	PSID pSid,
    	PACL pAclSource,
    	PACL *pAclDestination,
    	DWORD AccessMask,
    	BOOL bAddSid,
    	BOOL bFreeOldAcl
    )
    {
    	ACL_SIZE_INFORMATION	AclInfo;
    	DWORD					dwNewAclSize;
    	LPVOID					pAce;
    	DWORD					AceCounter;
    	BOOL					bSuccess=FALSE;
    
    	/*
    	** If we were given a NULL Acl, just provide a NULL Acl
    	*/
    	if (pAclSource == NULL)
    	{
    		*pAclDestination = NULL;
    		return TRUE;
    	}
    
    	if (!IsValidSid(pSid)) return FALSE;
    
    	/*
    	**	Get ACL's parameters
    	*/
    	if (
    		!GetAclInformation(
    			pAclSource,
    			&AclInfo,
    			sizeof(ACL_SIZE_INFORMATION),
    			AclSizeInformation
    		)
    	)
    		return FALSE;
    
    	/*
    	**	Compute size for new ACL, based on
    	**	addition or subtraction of ACE
    	*/
    	if (bAddSid)
    	{
    		dwNewAclSize = AclInfo.AclBytesInUse  +
    							sizeof(ACCESS_ALLOWED_ACE)  +
    							GetLengthSid(pSid)          -
    							sizeof(DWORD)               ;
    	}
    	else
    	{
    		dwNewAclSize = AclInfo.AclBytesInUse  -
    							sizeof(ACCESS_ALLOWED_ACE)  -
    							GetLengthSid(pSid)          +
    							sizeof(DWORD)               ;
    	}
    
    	*pAclDestination = (PACL) HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, dwNewAclSize);
    	if(*pAclDestination == NULL)
    		return FALSE;
    
    	/*
    	** initialize new Acl
    	*/
    	bSuccess = InitializeAcl(*pAclDestination, dwNewAclSize, ACL_REVISION);
    	if (bSuccess == FALSE)
    		goto finish5;
    
    	/*
    	** copy existing ACEs to new ACL
    	*/
    	for(AceCounter = 0 ; AceCounter < AclInfo.AceCount ; AceCounter++)
    	{
    		/*
    		** fetch existing ace
    		*/
    		bSuccess = GetAce(pAclSource, AceCounter, &pAce);
    		if (bSuccess == FALSE)
    			goto finish5;
    
    		/*
    		** check to see if we are removing the ACE
    		*/
    		if (!bAddSid)
    		{
    			/*
    			** we only care about ACCESS_ALLOWED ACEs
    			*/
    			if ((((PACE_HEADER)pAce)->AceType) == ACCESS_ALLOWED_ACE_TYPE)
    			{
    				PSID pTempSid=(PSID)&((PACCESS_ALLOWED_ACE)pAce)->SidStart;
    				/*
    				** if the Sid matches, skip adding this Sid
    				*/
    				if (EqualSid(pSid, pTempSid)) continue;
    			}
    		}
    
    		/*
    		** append ACE to ACL
    		*/
    		bSuccess = AddAce(
    						*pAclDestination,
    						ACL_REVISION,
    						0,  // maintain Ace order
    						pAce,
    						((PACE_HEADER)pAce)->AceSize
    					);
    		if (bSuccess == FALSE)
    			goto finish5;
    
    	}
    
    	/*
    	** If appropriate, add ACE representing pSid
    	*/
    	if (bAddSid)
    		bSuccess = AddAccessAllowedAce(
    						*pAclDestination,
    						ACL_REVISION,
    						AccessMask,
    						pSid
    					);
    
    finish5:
    	/*
    	** free memory if an error occurred
    	*/
    	if (!bSuccess)
    	{
    		if(*pAclDestination != NULL)
    			HeapFree(GetProcessHeap(), 0, *pAclDestination);
    	}
    	else if (bFreeOldAcl)
    		HeapFree(GetProcessHeap(), 0, pAclSource);
    
    	return bSuccess;
    }
    
    static BOOL
    setWinstaDesktopSecurity(
    	HWINSTA hWinsta,
    	HDESK hDesktop,
    	PSID pLogonSid,
    	BOOL bGrant,
    	HANDLE hToken
    )
    {
    	SECURITY_INFORMATION	si = DACL_SECURITY_INFORMATION;
    	PSECURITY_DESCRIPTOR	sdDesktop = NULL;
    	PSECURITY_DESCRIPTOR	sdWinsta = NULL;
    	SECURITY_DESCRIPTOR		sdNewDesktop;
    	SECURITY_DESCRIPTOR		sdNewWinsta;
    	DWORD					sdDesktopLength	= 0;	/* allocation size */
    	DWORD					sdWinstaLength	= 0;	/* allocation size */
    	PACL					pDesktopDacl;		/* previous Dacl on Desktop */
    	PACL					pWinstaDacl;        /* previous Dacl on Winsta */
    	PACL					pNewDesktopDacl	= NULL;	/* new Dacl for Desktop */
    	PACL					pNewWinstaDacl	= NULL;	/* new Dacl for Winsta */
    	BOOL					bDesktopDaclPresent;
    	BOOL					bWinstaDaclPresent;
    	BOOL					bDaclDefaultDesktop;
    	BOOL					bDaclDefaultWinsta;
    	BOOL					bSuccess		= FALSE;
    	PSID					pUserSid = NULL;
    
    	/*
    	** Obtain security descriptor for Desktop
    	*/
    	GetUserObjectSecurity(
    		hDesktop,
    		&si,
    		sdDesktop,
    		sdDesktopLength,
    		&sdDesktopLength
    	);
    
    	if (sdDesktopLength)
    		sdDesktop = (PSECURITY_DESCRIPTOR)HeapAlloc(
    						GetProcessHeap(), HEAP_ZERO_MEMORY, sdDesktopLength);
    
    	bSuccess = GetUserObjectSecurity(
    		hDesktop,
    		&si,
    		sdDesktop,
    		sdDesktopLength,
    		&sdDesktopLength
    	);
    
    	if (bSuccess == FALSE)
    		goto finish4;
    
    	/*
    	** Obtain security descriptor for Window station
    	*/
    	GetUserObjectSecurity(
    		hWinsta,
    		&si,
    		sdWinsta,
    		sdWinstaLength,
    		&sdWinstaLength
    	);
    
    	if (sdWinstaLength)
    		sdWinsta = (PSECURITY_DESCRIPTOR)HeapAlloc(
    							GetProcessHeap(), HEAP_ZERO_MEMORY, sdWinstaLength);
    
    	bSuccess = GetUserObjectSecurity(
    		hWinsta,
    		&si,
    		sdWinsta,
    		sdWinstaLength,
    		&sdWinstaLength
    	);
    
    	if (bSuccess == FALSE)
    		goto finish4;
    
    	/*
    	** Obtain DACL from security descriptor for desktop
    	*/
    	bSuccess = GetSecurityDescriptorDacl(
    					sdDesktop,
    					&bDesktopDaclPresent,
    					&pDesktopDacl,
    					&bDaclDefaultDesktop
    				);
    
    	if (bSuccess == FALSE)
    		goto finish4;
    
    	/*
    	** Obtain DACL from security descriptor for Window station
    	*/
    	bSuccess = GetSecurityDescriptorDacl(
    					sdWinsta,
    					&bWinstaDaclPresent,
    					&pWinstaDacl,
    					&bDaclDefaultWinsta
    				);
    
    	if (bSuccess == FALSE)
    		goto finish4;
    
    	/*
    	** Create new DACL with Logon and User Sid for Desktop
    	*/
    	if(bDesktopDaclPresent) {
    		bSuccess = setSidOnAcl(
    			pLogonSid,
    			pDesktopDacl,
    			&pNewDesktopDacl,
    			GENERIC_READ | GENERIC_WRITE | READ_CONTROL
    			| DESKTOP_READOBJECTS | DESKTOP_CREATEWINDOW
    			| DESKTOP_CREATEMENU | DESKTOP_SWITCHDESKTOP
    			| DESKTOP_ENUMERATE,
    			bGrant,
    			FALSE
    		);
    
    		if (bSuccess == FALSE)
    			goto finish4;
    	}
    
    	/*
    	** Create new DACL with Logon and User Sid for Window station
    	*/
    	if(bWinstaDaclPresent)
    	{
    		bSuccess = setSidOnAcl(
    						pLogonSid,
    						pWinstaDacl,
    						&pNewWinstaDacl,
    						GENERIC_READ | GENERIC_WRITE | READ_CONTROL
    						| WINSTA_ACCESSGLOBALATOMS
    						| WINSTA_ENUMDESKTOPS | WINSTA_READATTRIBUTES
    						| WINSTA_ACCESSCLIPBOARD | WINSTA_ENUMERATE
    						| WINSTA_EXITWINDOWS,
    						bGrant,
    						FALSE
    					);
    
    		if (bSuccess == FALSE)
    			goto finish4;
    	}
     
    	/*
    	** Initialize the target security descriptor for Desktop
    	*/
    	if (bDesktopDaclPresent)
    	{
    		bSuccess = InitializeSecurityDescriptor(
    						&sdNewDesktop,
    						SECURITY_DESCRIPTOR_REVISION
    					);
    
    		if (bSuccess == FALSE)
    			goto finish4;
    	}
    
    	/*
    	** Initialize the target security descriptor for Window station
    	*/
    	if(bWinstaDaclPresent)
    	{
    		bSuccess = InitializeSecurityDescriptor(
    						&sdNewWinsta,
    						SECURITY_DESCRIPTOR_REVISION
    					);
    
    		if (bSuccess == FALSE)
    			goto finish4;
    	}
    
    	/*
    	** Apply new ACL to the Desktop security descriptor
    	*/
    	if(bDesktopDaclPresent)
    	{
    		bSuccess = SetSecurityDescriptorDacl(
    						&sdNewDesktop,
    						TRUE,
    						pNewDesktopDacl,
    						bDaclDefaultDesktop
    					);
    
    		if (bSuccess == FALSE)
    			goto finish4;
    	}
    
    	/*
    	** Apply new ACL to the Window station security descriptor
    	*/
    	if(bWinstaDaclPresent)
    	{
    		bSuccess = SetSecurityDescriptorDacl(
    						&sdNewWinsta,
    						TRUE,
    						pNewWinstaDacl,
    						bDaclDefaultWinsta
    					);
    
    		if (bSuccess == FALSE)
    			goto finish4;
    	}
    
    	/*
    	** Apply security descriptors with new DACLs to Desktop and Window station
    	*/
    	if (bDesktopDaclPresent)
    	{
    		bSuccess = SetUserObjectSecurity(
    									hDesktop,
    									&si,
    									&sdNewDesktop
    					);
    
    		if (bSuccess == FALSE)
    			goto finish4;
    	}
    
    	if(bWinstaDaclPresent)
    		bSuccess = SetUserObjectSecurity(
    									hWinsta,
    									&si,
    									&sdNewWinsta
    					);
    
    	if (bSuccess == FALSE)
    		goto finish4;
    finish4:
    	if (sdDesktop != NULL)
    		HeapFree(GetProcessHeap(), 0, sdDesktop);
    
    	if (sdWinsta != NULL)
    		HeapFree(GetProcessHeap(), 0, sdWinsta);
    
    	if (pNewDesktopDacl != NULL)
    		HeapFree(GetProcessHeap(), 0, pNewDesktopDacl);
    
    	if (pNewWinstaDacl != NULL)
    		HeapFree(GetProcessHeap(), 0, pNewWinstaDacl);
    
    	return bSuccess;
    }
    
    static BOOL
    allowDesktopAccess(HANDLE hToken)
    {
    	HWINSTA	hWinsta = NULL;
    	HDESK	hDesktop = NULL;
    	PSID	pLogonSid = NULL;
    	BOOL	ok = FALSE;
    
    	if (!getAndAllocateLogonSid(hToken, &pLogonSid))
    		return FALSE;
    
    	hWinsta=GetProcessWindowStation();
    	hDesktop=GetThreadDesktop(GetCurrentThreadId());
    	 
    	ok = SetHandleInformation(hDesktop,
    							  HANDLE_FLAG_INHERIT, HANDLE_FLAG_INHERIT);
    	if (!ok)
    		return FALSE;
    
    	ok = SetHandleInformation(hWinsta,
    							  HANDLE_FLAG_INHERIT, HANDLE_FLAG_INHERIT);
    	if (!ok)
    		return FALSE;
    
    	ok = setWinstaDesktopSecurity(hWinsta, hDesktop, pLogonSid, TRUE, hToken);
    
    	if(pLogonSid != NULL)
    		HeapFree(GetProcessHeap(), 0, pLogonSid);
    
    	return ok;
    }
    
    void WINAPI ServiceControlHandler( DWORD controlCode )
    {
    	switch ( controlCode )
    	{
    	case SERVICE_CONTROL_INTERROGATE:
    		break;
    
    	case SERVICE_CONTROL_SHUTDOWN:
    	case SERVICE_CONTROL_STOP:
    		serviceStatus.dwCurrentState = SERVICE_STOP_PENDING;
    		SetServiceStatus( serviceStatusHandle, &serviceStatus );
    
    		SetEvent( stopServiceEvent );
    		return;
    
    	case SERVICE_CONTROL_PAUSE:
    		break;
    
    	case SERVICE_CONTROL_CONTINUE:
    		break;
    
    	default:
    		if ( controlCode >= 128 && controlCode <= 255 )
    			// User defined control code
    			break;
    		else
    			// unrecognised control code
    			break;
    	}
    
    	SetServiceStatus( serviceStatusHandle, &serviceStatus );
    }
    
    #define	COMMAND	"NOTEPAD.EXE"
    #define USER "John Doe"
    #define DOMAIN "."
    #define PASSWORD "johndoe"
    
    void WINAPI ServiceMain( DWORD argc, TCHAR* argv[] )
    {
    	HANDLE				hToken = NULL;
    	BOOL				ok = FALSE;
    	STARTUPINFO			startup_info;
    	PROCESS_INFORMATION	proc_info;
    	LPTSTR				lpCmd = NULL;
    	char				lpSystemDir[MAX_PATH];
    
    	// initialise service status
    	serviceStatus.dwServiceType = SERVICE_WIN32;
    	serviceStatus.dwCurrentState = SERVICE_STOPPED;
    	serviceStatus.dwControlsAccepted = 0;
    	serviceStatus.dwWin32ExitCode = NO_ERROR;
    	serviceStatus.dwServiceSpecificExitCode = NO_ERROR;
    	serviceStatus.dwCheckPoint = 0;
    	serviceStatus.dwWaitHint = 0;
    
    	serviceStatusHandle = RegisterServiceCtrlHandler ( serviceName, ServiceControlHandler );
    
    	if ( serviceStatusHandle )
    	{
    		// service is starting
    		serviceStatus.dwCurrentState = SERVICE_START_PENDING;
    		SetServiceStatus ( serviceStatusHandle, &serviceStatus );
    
    		// do initialisation here
    		stopServiceEvent = CreateEvent( 0, FALSE, FALSE, 0 );
    
    		//running
    		serviceStatus.dwControlsAccepted |= (SERVICE_ACCEPT_STOP | SERVICE_ACCEPT_SHUTDOWN);
    		serviceStatus.dwCurrentState = SERVICE_RUNNING;
    		SetServiceStatus( serviceStatusHandle, &serviceStatus );
    
    		ok = LogonUser(
    							TEXT(USER),
    							TEXT(DOMAIN),
    							TEXT(PASSWORD),
    							LOGON32_LOGON_INTERACTIVE,
    							LOGON32_PROVIDER_DEFAULT,
    							&hToken
    				);
    			if (ok == FALSE)
    				goto finish2;
    
    			ok = allowDesktopAccess(hToken);
    			if (ok == FALSE)
    				goto finish2;
    
    			ZeroMemory(&startup_info,sizeof(STARTUPINFO));
    
    			startup_info.cb = sizeof(STARTUPINFO);
    
    			startup_info.wShowWindow = SW_SHOW;
    
    			startup_info.dwFlags = STARTF_USESTDHANDLES;
    
      			startup_info.lpDesktop = (LPTSTR) "Winsta0\\Default";
    
    			ok = GetSystemDirectory(lpSystemDir, MAX_PATH);
    			if (ok > 0)
    			{
    				lpCmd = (char *) LocalAlloc(LPTR, ok + strlen(COMMAND) + 2);
    				sprintf(lpCmd, "%s\\%s", lpSystemDir, COMMAND);
    			}
    			else
    				goto finish2;
    
    			ok = CreateProcessAsUser(
    										hToken,
    										NULL,
    										lpCmd,
    										NULL,
    										NULL,
    										TRUE,
    										0,
    										NULL,
    										NULL,
    										&startup_info,
    										&proc_info);
    
    			if (ok == TRUE)
    			{
    				CloseHandle(proc_info.hThread);
    				CloseHandle(proc_info.hProcess);
    			}
    
    finish2:
    			if (ok == FALSE)
    			{
    				LPTSTR 	lpMsgBuf;
    				DWORD	cnBytes;
    
    				cnBytes = FormatMessage(
    										FORMAT_MESSAGE_ALLOCATE_BUFFER |
    										FORMAT_MESSAGE_FROM_SYSTEM |
    										FORMAT_MESSAGE_MAX_WIDTH_MASK,
    										NULL,
    										GetLastError(),
    										MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), // Default language
    										(LPTSTR)&lpMsgBuf,
    										0,
    										NULL 
    					);
    
    			if (cnBytes > 0)
    			{
    				MessageBox(NULL, lpMsgBuf, "SECBUG", MB_OK);
    				LocalFree(lpMsgBuf);
    			}
    		}
    
    		if (lpCmd != NULL)
    			LocalFree(lpCmd);
    
    		if (hToken != NULL)
    			CloseHandle(hToken);
    		do { // nothing
    
    		} while (WaitForSingleObject( stopServiceEvent, 5000 ) == WAIT_TIMEOUT );
    
    		// service was stopped
    		serviceStatus.dwCurrentState = SERVICE_STOP_PENDING;
    		SetServiceStatus( serviceStatusHandle, &serviceStatus );
    
    		// do cleanup here
    		CloseHandle( stopServiceEvent );
    		stopServiceEvent = 0;
    
    		// service is now stopped
    		serviceStatus.dwControlsAccepted &= ~(SERVICE_ACCEPT_STOP | SERVICE_ACCEPT_SHUTDOWN);
    		serviceStatus.dwCurrentState = SERVICE_STOPPED;
    		SetServiceStatus( serviceStatusHandle, &serviceStatus );
    	}
    }
    
    void RunService()
    {
    	SERVICE_TABLE_ENTRY serviceTable[] =
    	{
    		{ serviceName, ServiceMain },
    		{ 0, 0 }
    	};
    
    	StartServiceCtrlDispatcher ( serviceTable );
    }
    
    void InstallService()
    {
    	SC_HANDLE serviceControlManager = OpenSCManager( 0, 0, SC_MANAGER_CREATE_SERVICE );
    
    	if ( serviceControlManager )
    	{
    		TCHAR path[ _MAX_PATH + 1];
    		if ( GetModuleFileName( 0, path, sizeof(path)/sizeof(path[0]) ) > 0 )
    		{
    			SC_HANDLE service = CreateService( serviceControlManager,
    				serviceName, serviceName,
    				SERVICE_ALL_ACCESS, SERVICE_WIN32_OWN_PROCESS | SERVICE_INTERACTIVE_PROCESS,
    				SERVICE_AUTO_START, SERVICE_ERROR_IGNORE, path,
    				0, 0, 0, 0, 0);
    			if (service)
    				CloseServiceHandle( service );
    		}
    
    		CloseServiceHandle( serviceControlManager );
    	}
    }
    
    void UninstallService()
    {
    	SC_HANDLE serviceControlManager = OpenSCManager( 0, 0, SC_MANAGER_CONNECT );
    
    	if (serviceControlManager )
    	{
    		SC_HANDLE service = OpenService( serviceControlManager,
    			serviceName, SERVICE_QUERY_STATUS | DELETE );
    		if ( service )
    		{
    			SERVICE_STATUS serviceStatus;
    			if ( QueryServiceStatus( service, &serviceStatus ) )
    			{
    				if ( serviceStatus.dwCurrentState == SERVICE_STOPPED )
    					DeleteService ( service );
    			}
    
    			CloseServiceHandle( service );
    		}
    
    		CloseServiceHandle( serviceControlManager );
    	}
    }
    
    int _tmain( int argc, TCHAR* argv[] )
    {
    	if ( argc > 1 && lstrcmpi( argv[1], TEXT("install") ) == 0)
    	{
    		InstallService();
    	}
    	else if ( argc > 1 && lstrcmpi( argv[1], TEXT("uninstall") ) == 0 )
    	{
    		UninstallService();
    	}
    	else
    	{
    		RunService();
    	}
    
    	return 0;
    }
    Of course the hello world popup is a snap.

    Code:
    #include <windows.h>
    
    int WINAPI WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance, PSTR szCmdLine, int iCmdShow)
    {
    	MessageBox(NULL, TEXT("Hello World!"), TEXT("HelloMsg"), 0);
    
    	return 0;
    }

  8. #108
    Relic Horn
    Join Date
    Jul 2005
    Posts
    3,017
    BG Level
    7

    Quote Originally Posted by Devek
    Quote Originally Posted by SephirothYuyX
    Sure yeah, you may be able to pull some sort of code off, but is it efficient? Does it take up minimal space/size/run fast? Does it fit to the individual company specs? Probably not.
    Maybe not from the first tutorial.. but when the need grows from simply moving code around there are reference you can find through Google to increase your skills as much as you need to.

    There is a limited amount of knowledge you can fit inside your brain.. it just isn't possible to know everything at any one time and no jobs really prepares you for the next because everyone does things differently.

    The ability to quickly pickup and learn new knowledge on demand is much more important than what you actually know because what you actually know is most likely to be irrelevant when you start a new job.

    I bet I could pull off just about any basic task using any language or technology THAT WAS AVAILABLE TO ME within 24 hours if needed.
    Simple. Translate 'All that I want is food' into modern standard German. There is one part about this that will make it tricky and will be hard to find on a search.

    Edit: You said any language....even if you did mean comptuer wise I'm taking you literally =D

  9. #109
    Relic Horn
    Join Date
    Jul 2005
    Posts
    3,017
    BG Level
    7

    Quote Originally Posted by Joran
    Gonna be a schoolteacher hopefully, when I graduate in about a year. So, yeah I'm supposed to think education is THE most important thing. I just absolutely hate old teachers though. Because most of them were trained in the Jurrasic period when the universally accepted method for teaching was "sit down, shut up, and learn". No interaction, just lecture. So boring. I feel you really gotta do everything you can to hold their interest. Not just teach, teach to create understanding.
    I'm following pretty much the same path as you right now. I'm currently majoring in German and plan to go for a PhD in it or some kind of other linguistic field. I've had wayyyy too many bad language teachers (I usually start one new language a semiseter and continue the ones I enjoy) and well...I know I could do better.

  10. #110
    Yoshi P
    Join Date
    Jul 2005
    Posts
    5,016
    BG Level
    8

    So you know how to cut and paste and change around function/variable names.

    The reason I asked the question I did is because I knew you'd find that exact sample, and instead of trying to understand how to make things work, you just copied the code and changed around variable names and basic code flow. The code sample you copied and altered has numerous bugs, some of which aren't that hard to find, and some of which are very subtle. This is why your google philosophy fails. If you don't understand what it is you're copying / regurgitating, don't bother regurgitating it because while you can fool people who aren't familiar with the area, you can't fool the people who are.

  11. #111
    Chram
    Join Date
    Jun 2006
    Posts
    2,539
    BG Level
    7

    Quote Originally Posted by divisortheory
    So you know how to cut and paste and change around function/variable names.

    The reason I asked the question I did is because I knew you'd find that exact sample, and instead of trying to understand how to make things work, you just copied the code and changed around variable names and basic code flow. The code sample you copied and altered has numerous bugs, some of which aren't that hard to find, and some of which are very subtle. This is why your google philosophy fails. If you don't understand what it is you're copying / regurgitating, don't bother regurgitating it because while you can fool people who aren't familiar with the area, you can't fool the people who are.
    What are you talking about? The code samples I merged was http://www.muukka.net/programming/Beeper%20Service.cpp and http://win32.mvps.org/security/lu_cpau_gui.cpp whcih may or may not have the same bugs as the one on the microsoft site that you linked to. The only bug I know of for a fact is if you are screwing around and uncheck "Allow service to interact with desktop" it crashes in a condition that requires a reboot to clear

    I don't see how it matters.. I was able to do your basic task in short time and I am not a windows programmer. Including "hello world" and my voke bot that was my third program of any type to write on a Windows platform EVER. I am sure if I spent more time I could study the API and see what it is really doing and build some test cases to check for bugs but I don't have to because you're not paying me. You offered a challenge and I did it faster than I said I could.

    Google FTW

  12. #112
    Yoshi P
    Join Date
    Jul 2005
    Posts
    5,016
    BG Level
    8

    I offered a challenge to create a solution to a problem. The reason people offer challenges to others at all is to see how well you understand things. Had you researched what a window station is, what a desktop is, what a logon sid is, what an session, token, ace, acl, security descriptor, etc is then digested all of that, then come up with a solution on your own, that would have passed. The reason it fails is because you have no idea if that code works (which, in fact, it doesn't sometimes). But you don't know why, how, or when it doesn't work. Imagine submitting that to your boss, you wouldn't feel a little nervous checking code into a mission critical system where people's lives depended on the software having zero bugs if you had no fucking idea what the code you just copied off of a random website even did? good fucking game.

    As much as you might like to think otherwise, solving real world problems is about deep understanding and analytical problem solving ability, and it has nothing to do with quick and dirty cookbook recipes.

    How many bugs can you find in this code?
    Code:
    int main()
    {
         std::vector<DateTime> e;
         std::copy( std::istream_iterator<DateTime>( cin ),
                  std::istream_iterator<DateTime>(),
                  std::back_inserter( e ) );
    
         vector<DateTime>::iterator first = std::find( e.begin(), e.end(), "01/20/95" );
         vector<DateTime>::iterator last = std::find( e.begin(), e.end(), "10/14/95" );
         *last = "10/14/95";
         std::copy( first, last, std::ostream_iterator<DateTime>( std::cout, "\n" ) );
         e.insert( --e.end(), DateTime.Today() );
         std::copy( first, last, std::ostream_iterator<DateTime>( std::cout, "\n" ) );
    }
    Why is it impossible to overload the C++ assignment operator ( operator =() ), as a non-member friend function?


    When you go in for a job interview, guess what? You aren't going to have google handy to make it look like you know more than you actually do. And the job will most definitely go to the guy who knows the most.


    It doesn't matter if you can google the answer to those two questions (although i doubt you'll find those answers on google), because the point is that if the information is not already in your head, you cannot use it to make internal connections. You cannot make deuctions, inferences, assumptions, or hypotheses because you do not actually know anything.

  13. #113
    Chram
    Join Date
    Jun 2006
    Posts
    2,539
    BG Level
    7

    Now you've gone on the deep end.

    Obviously I didn't have totally deep understand of everything that went on there.. BUT WHY SHOULD I? I got the job done and if I need to be an expert.. I'll take the time to be one but when my employment has never and will never involve windows systems it is a total waste of time. However if I worked at a job that did require windows programming.. I would quickly become an expert from lots of Googling

    I can throw that crap back ya know.

    On a UNIX platform write a server that can talk to a series of clients with shared memory. You can use SYS V IPC to setup the shared memory but you can't use anything that requires a system call to synchronize communication so no SYS V semaphores for you.

    Just to clarify that is two way communication with all of them sharing the same buffer.. when a client gets a lock to write to it they hold onto it until they are finished and signal that the server needs to respond, they hold onto the lock until they read the response from the server and no one can write to the buffer in the mean time.

    No system calls, but you can use more than one buffer as long as it scales and you aren't making a buffer for each process.

    I could do that when I was 14(12 years ago ) and unless you can come back with not just working code but deep understanding of all the concepts involved you are clearly not qualified to be a computer engineer since you didn't know everything under the sun.

    If by some weird chance you know how to do that.. well screw you I'll find something you can't do

  14. #114
    VZX
    VZX is offline
    Relic Shield
    Join Date
    Dec 2006
    Posts
    1,700
    BG Level
    6
    FFXI Server
    Asura

    Is it bad that I have little to no experience with win32 programming being in 4th year of comp sci? (I kinda done with all my comp sci/math subjects, just need few more credits to fill in the 120 credits)

  15. #115
    Banned.

    Join Date
    Jul 2005
    Posts
    17,471
    BG Level
    9
    FFXI Server
    Ifrit
    WoW Realm
    Area 52

    Quote Originally Posted by jerkbox
    devek's point is that the actual content you learn in college is all researchable on google, which is probably true... i dont think he's saying you can get a job as easy as someone who's received a degree.
    I just finished my bacc in computer science and spend my day looking for info on google. >_> Google is everyone best friend, unless your job is actually to do research about new subject...in which case, you are screwed up.



    Quote Originally Posted by VZX
    Is it bad that I have little to no experience with win32 programming being in 4th year of comp sci? (I kinda done with all my comp sci/math subjects, just need few more credits to fill in the 120 credits)
    Nah. You learn programming by yourself, school just teach you method to learn how to make efficient program and stuff like that. Well, thats how it was for me.

  16. #116
    VZX
    VZX is offline
    Relic Shield
    Join Date
    Dec 2006
    Posts
    1,700
    BG Level
    6
    FFXI Server
    Asura

    Quote Originally Posted by Kaylia
    Quote Originally Posted by jerkbox
    devek's point is that the actual content you learn in college is all researchable on google, which is probably true... i dont think he's saying you can get a job as easy as someone who's received a degree.
    I just finished my bacc in computer science and spend my day looking for info on google. >_> Google is everyone best friend, unless your job is actually to do research about new subject...in which case, you are screwed up.
    I think researchers still need to look up different kind of information developed previously (so they can have a novelty in their work). But I doubt they'll use Google though.

  17. #117
    Ridill
    Join Date
    May 2005
    Posts
    13,568
    BG Level
    9

    Quote Originally Posted by VZX
    Is it bad that I have little to no experience with win32 programming being in 4th year of comp sci? (I kinda done with all my comp sci/math subjects, just need few more credits to fill in the 120 credits)
    nah, you can learn most of what you need for win32 programming through google, provided you have the basis in languages, hardware & software design, algorithms, etc that you should have picked up in college. 8)

  18. #118
    Relic Horn
    Join Date
    Mar 2006
    Posts
    3,215
    BG Level
    7

    Quote Originally Posted by VZX
    Is it bad that I have little to no experience with win32 programming being in 4th year of comp sci? (I kinda done with all my comp sci/math subjects, just need few more credits to fill in the 120 credits)
    If so, it's probably even worse that I have absolutely no experience with win32 and I already have my BS in Comp Sci.

    And as for the German question up there, I can translate it conceptually as "Ich will nur Nahrung", but I'm not sure if there is a truly literal translation. I don't remember hearing about an equivalent to the phrase "all I want", so you could just break it up and use an interjected clause (that's what lolbabelfish says with "Alle, die ich wünsche, ist Nahrung."), or you might just have to phrase it the same way and use a subjunctive, with "Alle ich wünsche ist Nahrung. But one or the other of those probably makes the obvious mistake you mentioned. Unless the issue you were referring to was the lack of a direct equivalent to "all I want". Oh, or it could be something strange going on with the word Nahrung itself, but I can't find my translation dictionary to be sure. And either way all three are probably wrong, because I only took German in high school anyway.

    Does this count as derailing a derail?

  19. #119
    Banned.

    Join Date
    Jul 2005
    Posts
    17,471
    BG Level
    9
    FFXI Server
    Ifrit
    WoW Realm
    Area 52

    Quote Originally Posted by VZX
    Quote Originally Posted by Kaylia
    Quote Originally Posted by jerkbox
    devek's point is that the actual content you learn in college is all researchable on google, which is probably true... i dont think he's saying you can get a job as easy as someone who's received a degree.
    I just finished my bacc in computer science and spend my day looking for info on google. >_> Google is everyone best friend, unless your job is actually to do research about new subject...in which case, you are screwed up.
    I think researchers still need to look up different kind of information developed previously (so they can have a novelty in their work). But I doubt they'll use Google though.
    Yeah, I know. Wasnt really serious when I said that, but it's still have some truth ;p





    Quote Originally Posted by VZX
    Is it bad that I have little to no experience with win32 programming being in 4th year of comp sci? (I kinda done with all my comp sci/math subjects, just need few more credits to fill in the 120 credits)
    Nah. You learn programming by yourself, school just teach you method to learn how to make efficient program and stuff like that. Well, thats how it was for me. You do learn programming while doing homework and the like, but you can't learn everything like this.

  20. #120
    Chram
    Join Date
    Jun 2006
    Posts
    2,539
    BG Level
    7

    Wait.. I thought college was supposed to make everyone experts with deep understanding of win32.

    Shocked.

Page 6 of 9 FirstFirst ... 4 5 6 7 8 ... LastLast

Similar Threads

  1. So what level is your progress quest character?
    By Iggystar in forum General Discussion
    Replies: 15
    Last Post: 2006-02-18, 02:23