System Programming





Kernel and system programming is the process of creating the software necessary for a computer or device to function and operate other programs. Some operating systems (such as Microsoft Windows) are proprietary, but others, such as the various Linux distributions, are open source.

Share tech news, updates, or what's on your mind.

Sign up to Post

Hi Experts,

I am researching payment processing options for the product I described when asking this question:  

To summarize:  I have a product with 10 features and would like customers to be able to buy 1 or more features.  Ideally, after purchase they would be provided a single registration key which would allow them to activate all purchased features at the same time.

Can anyone recommend a reliable and cost-effective e-commerce site for distributing this product?  

Hi all,

I have a product that was developed in VC++ and consists of an EXE file and several DLLs.  I would like to distribute a stripped-down version of the product for free and sell additional features on a feature-by-feature basis (each feature being independent of the others).  For example, if there are 10 features user A might purchase features 1, 2 and 6, user B might purchase features 3, 4 and 6, and user C might purchase all 10 features in a bundle.  Can anyone recommend a product that can do this?

I'd also like to protect the code from reverse engineering after it is published.  Can anyone recommend a product to do this?  Ideally, this would be the same product as the one for my first question, but this is not strictly necessary.


I was wondering if an expert could help me with IAT patching on NT based O/Ss as I've come a little unstuck.  I'm trying to install an API hook using DLL injection (LoadLibrary/CreateRemoteThread technique), and then patch a couple of OpenGL functions to be able to intercept their parameters and perform operations before calling the originals.  All of this is working apart from, it seems, when I call back to the original versions of functions that have a parameter list - calling back to functions with no parameters is fine.

I suspect it is how I've specified by function pointers, I'm new to this technique and can't seem to figure out which is the correct way of doing things.  When I call back to the original functions with the parameter list it just crashes the target process.

The code I'm using is as follows:-

// Pointer to original function:

void (WINAPI *glRotatefOrig)(GLfloat  angle, GLfloat x, GLfloat y, GLfloat z);

// Code to get original function pointer:

glRotatefOrig = (void (WINAPI *)(GLfloat, GLfloat, GLfloat, GLfloat)) GetProcAddress(hMod, "glRotatef"); // hMod = handle to openGL module.

// My own function implentation (this is called successfully by the target process following IAT patch):

void myglRotatef( GLfloat angle,  GLfloat x,  GLfloat y,  GLfloat z)
      console->Write("glRotatef Called\n"); // prints ok
      glRotatefOrig(angle, x, y, z); // This call crashes the application (no meaningful error given).

Can anyone …
Hi All,

I am using MFC in Visual Studio 2008.  I have a CMDIFrameWndEx which has a CMFCMenuBar as the app-wizard provides.

I also have a menu resource, IDR_SCENE.

At runtime, I want to add the IDR_SCENE menu dynamically to the main menu bar.  Declaring the menu in my class:

CMenu m_sceneMenu;

Open in new window

I then try and insert it like this during creation:

::InsertMenu(pParentWnd->GetMenuBar().GetHMenu(), 0, MF_BYPOSITION | MF_POPUP, reinterpret_cast<UINT_PTR>((HMENU)(*m_sceneMenu.GetSubMenu(0))), NULL);

Open in new window

But, I never, ever see it.  No errors occur.  I have done some searching and this appears to be the way to do it.

Can anyone assist?

Thanks in advance
I want to run two different high CPU consuming process in two different processor. I have dual core unix machine.
I have a web service returning data from a MS SQL database that I wish to query with an iPhone app. I want to have user enter username and password in the iPhone app, then it will interact with the .NET web service to return the values based on username and password.

Can anyone help in xCode programming for this? I am new to iPhone development.

Thank you.
Hey experts,

This is a tricky one:

I have two servers, the first one is a NAS and the second I`ll call XTREAMER (It's a media center with limited shell functions - running BusyBox).

XTREAMER has no rsync capability, but it`s able to connect to NAS without a password (ssh key installed)
NAS cannot connect via ssh to XTREAMER (installing ssh keys on XTREAMER does not work).

So basically I tought I could just copy files using scp:

scp user@NAS:/nasfolder/ /xtreamerfolder/

Open in new window

The problem is that I`d like to check if the file is already on XTREAMER, and if it is I do not wish to copy it.

Can somebody help me out with a script that connects from XTREAMER to NAS, gets a list of files/folders on NAS, checks the ones that exist back on XTREAMER and scp those that do not exist on XTREAMER? (remember that ssh only works from XTREAMER to NAS so scp has to run on XTREAMER side)

Keep in mind that XTREAMER has really limited unix functions. I know ssh/scp is working fine though.

Thanks a lot, sorry I couldn`t come up with a code, unix programming is just not my thing :/

I hope I made myself clear :)
We use AtlTraceTool8 of VS2005 to switch on certain trace info while debugging.
On my W7 x64, AtlTraceTool8 works only for a certain period of time, after that no application including itself is displayed anymore, and refreshing leads to a app crash.

For test I logged in freshly, started AtlTraceTool8 (which displayed itself as an valid application), and locked the PC over night. Next morning, after refreshing AtlTraceTool8 display, nothing is there anymore.

After logging out and in again, everything is fine.

Anybody able to explain that? It is really nasty, as we have created an own trace category, and I'm no longer seeing important debugging info.
Is it possible to install Firefox or another fully featured browser (as in not a text only browser) on a unix web server. And then run a site though it, and time how long it takes.
If possible, also measure how long each component takes.
I have found sites such as the following, who measure page load time, and i can mostly create this in php, but I'm using curl and other requests, while i think if i could install a browser on the server, and then run sites through it and time sections i could replicate this.
Similar to:

Anyone have experience with this, or any ideas, please let me know.
I am running this command on HP UNIX.  I have 60 tar files that contain multiple files totaling about 2GB of data in each tar file.  The following command is working fine to extract the files.  The issue is I don't have enough disk space for all the .tar files and the .dat files it contains to exist at the same time.  I want to extract data from FILE1.tar to FILE1A.dat, FILE1B.dat and then delete FILE1.tar before moving on to file FILE2.tar.  Is there a way to automatically delete the .tar file once the data has been extracted to the .dat file?  

for tarfile in *tar;  do tar -xvf $tarfile; done

howi t is possible to check whether a window has hwnd and is "visible" but not in Front/onTop?
I need to know when the window will lost TopPosition but is still visible (not minimized).

I have a script that calls two other scripts.

When I run the script manually, it works fine. But when I run it from CA-7 scheduler, it doesn't work.

In the script below, I thought that for sure when I changed this:
./ $this_source PRD
to this:
./slice6/imedw/dev_non_compile/ $this_source PRD

I would be good to go, the thought being that when the job is run from CA-7, I need to specify the full path to the job.

When I run it manually (like this ./ $this_source PRD) I am sitting in the proper directory where the .sh script resides.

Here is the output when running from CA-7
Now running driver for Product CDR Loader script
process started on Wednesday, July 07, 2010 12:41:51
source = 075
Calling cdr_loader script at Wednesday, July 07, 2010 12:41:51
Analysis started on Wednesday, July 07, 2010 12:41:51   <------------ so "cdr loader" ran in "0 seconds"
Integrations started on Wednesday, July 07, 2010 12:41:51  <------------- Analysis also ran in "0 seconds"
Product CDR load process completed  on Wednesday, July 07, 2010 13:31:05

Here is the output when I run it manually:
Now running driver for Product CDR Loader script
process started on Wednesday, June 30, 2010 17:19:52
source = 075
Calling cdr_loader script
Calling analysis script
Analysis started on Thursday, July 01, 2010 02:24:02  <-- so cdr_loader ran ~9 hours
Calling Integrations
Integrations started on Thursday, July …
Dear all,
     I have a VC++ project that is currently a COM library that is being used by another VB.NET project. Apparently, COM is a headache in terms of version and registration. So I am going to build it into a non-Com library that doesn't require register. My questions are below:

    1.  I am using MS VC++ 2005 pro compiler. I made a new project that is CLR+class Library. I plan to add codes from the original project into this new one in the hope of starting a clean new project that is .NET managed DLL (so it is not com), is this a viable way to do it?

    2. right after I created the project, I did a compile, it gives this error:
fatal error C1189: #error: Building MFC application with /MD[d] (CRT dll version) requires MFC shared dll version. Please #define _AFXDLL or do not use /MD[d]

    Any suggestions, please.

C# WinXP

I'm tring to write a class that connects to the internet using a modem (3G). I am using the Win32 API function called InternetDial to make the connection. This works Ok, except that if there is a failure (no dial tone etc), Windows pops up a dialog message describing the problem. I would like this class to operate in an unattended environment and therefore I don't want it to show any dialog messages - I want it to fail with no dialog/user intervention.

There is a flag called INTERNET_AUTODIAL_FORCE_UNATTENDED which appears to offer this functionality, except that annoyingly Windows still pops up a dialog when the dial-up fails.

Here is my class (from

	public class Dialer
		private IntPtr Handle;

		public Dialer(IntPtr handle)
			Handle = handle;

		EntryPoint="InternetGetConnectedState", ExactSpelling=true,
		private static extern bool InternetGetConnectedState(ref Int32
		lpdwFlags, Int32 dwReserved);

		EntryPoint="InternetDial", ExactSpelling=true,
		private static extern Int32 InternetDial(IntPtr hwndParent, string
		lpszConnectoid, Int32 dwFlags, ref Int32 lpdwConnection, Int32


Open in new window

Here is the issue, I have written a ksh script that is to be run both Unix and Linux, since the script containts logic and features that only "korn" will give better/valid result, so what I want is:

whenever this program is excuted, make sure it will be running like below:

$ ksh

if user enter $ sh
the program will prompt the use to enter "ksh" instead.

Why I am asking for this,  so I don't need to care wheather the default shell for a give user is a bash/csh/

What I want is logic in "" to check if user does enetr the ksh before the $0 !

Thank you,


I have a file name /path/main/file.txt

i want to append text "processing_" to the file name

output should look like  

Thanks for your help.

I've got a fairly large VS2008/MFC application that has been around for quite some time.    The program has functionality to have sounds played (using PlaySound) when certain events occur.   It's seldom used and frankly I rarely test anything to do with it.  So,  I didn't notice that at some point the PlaySound quit working with Windows 7.      I can take a current version of the program and it works fine on Windows XP, but nothing happens on Windows 7.   I can get small sample apps to work ok in W7 using the same WAV files so I know this not related to the WAV file itself.

The code is basically this:
  PlaySound(_T("C:\\Windows\Media\\Tada.wav"), NULL,  SND_FILENAME | SND_ASYNC );

What I've done so far is:
1)  Tried different combinations of the SND_* constants.
2)  Tried creating another thread and executing it there using SND_SYNC
3)  Tried removing as many  dependencies on outside libraries as possible.
4)  Tried playing WAV files that come with Windows, Aliases.   Nothing works in this application, but does in test applications.

As I said,  I can create test apps that work ok.    If I play the sound using SND_SYNC, it fails but you can't use GetLastError() to find out why.   Using SND_ASYNC will cause PlaySound to always return
true, but no sound comes out.   I'm really at a loss with this.   Clearly there's something I'm doing to cause the problem but at this point I don't know how to troubleshoot this any further.   Does anyone have any idea what I …
where can i find free ebooks of learning clarion programming

tnx a lot.
I have an MFC application that has used XP look for many years (previously built with VS23003 and MFC7).  When rebuilt with MFC9 (and MFC10) it reverts to old (W2K) look.  Ie, the buttons are an ugly grey with square corners, and there is no mouse over highlighting of buttons, tabs etc.

I have spent a huge amount of time researching this to no avail.  And yes, I have included the manifest (tried both as resource and separate .exe.manifest file).  I have also tried many other things to numerous to list.

Its obvious it can work as the samples show the correct look.  However, I have tried many approaches but it is very difficult to isolate what is causing the problem.  I have tried selectively removing parts of the program but the problem still happens (until I remove so much that it is impossible to get it to compile and run).

There must be a way to find out why the "XP look" is not being applied but I have yet to find any information from MS or elsewhere that documents what is happening behind the scenes.

When you call CoInitializeEx inside a thread. The MSDN states, 'Initializes the COM library for use by the calling thread'

Question 1: Doesn't this mean ANY COM object registered in the system is available for the thread to use?
Question 2: Logically does this happen: If the thread comes across a member for which is not define, it searches to com library for it?
Question 3: It's is possible to programmaticly (or otherwise) pull the list of available com objects?

I have a problem to receive the free disk space with an UNC path.
Like "\\HPOne\Video\Temp\" reports allways -1 if I try to call it with GetDiskFreeSpaceEx.
A nornal "C:\Test\" works fine. Any Idea? MSDN states that it will work with UNC.

I want to upload my application to appstore(ITune connect) , but after i upload my binary , at application detail there my "Device Family" is blank

So I want to set the target device family at my Xcode ,but i went to Projet>Build>deployment , but my" target Device family" column was disappear.

i was followed here to do:

my Xcode version : 3.1.4
my iphone sdk version : 3.0

how can i specify my target device family? in xcode 3.14 sdk 3.0

any one can help me?
I have the following in my MFC project:

char msg[1024];
strcpy (msg, "Unknown media type ");
MessageBox (NULL, msg, _T("WARNING!"), MB_OK);

I get the following error:
error C2664: 'MessageBoxW' : cannot convert parameter 2 from 'char [1024]' to 'LPCWSTR'

How do I fix this?????

As we know computer works on binary system. It means that each information like integer numbers, floating point numbers, text/strings, picture, audio, video etc are stored and represented in binary system (1 and 0).

I have few doubts. Please clarify them:

1. Since each type of information is stored in the form of 1/0 then how computer differentiates whether this is a number or a string or a picture. Where this encoding information is stored?

2. What is character encoding. Why its needed and how it works. What different types of encoding are there and which encoding is used where. How we know that what encoding is used in some context.

3. For representing numbers (decimal/binary)which encoding is used?

I read about different number systems and encoding but putting all together its difficult to say how it works. How computer processes and stores different types of data.

Thanks in advance

I need to know if it is possible to develop an iphone app that works with a subscription website that you don't own? For example, could I make my own facebook app and access some of the functionality of facebook as if I am logged in? I'm not really asking about facebook, but I'm asking about another website that I have a username and password for and want to access info from my own account. so I would have to create a login inside the app and then get my info from their servers

System Programming





Kernel and system programming is the process of creating the software necessary for a computer or device to function and operate other programs. Some operating systems (such as Microsoft Windows) are proprietary, but others, such as the various Linux distributions, are open source.