System Programming

40K

Solutions

19K

Contributors

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

I am writing a software removal program, and want to uninstall a context menu driver. Just unregistering the driver while Windows File Explorer is open causes a Windows error "Program has stopped working" when trying to unregister the dll. Closing file explorer first and then running the program works fine.

Here is the unregister code I am using now:

HINSTANCE hLib = LoadLibraryW(szDllPath);

    if (hLib == NULL)
    {
		DWORD dwErrorCode = GetLastError();
		szError.Format(_T("\nWindows could not load library %s due to %s"),szDllName,getLastWinError(dwErrorCode));
		return false;            
    }

    typedef HRESULT (CALLBACK *HCRET)(void);
    HCRET lpfnDllRegisterServer;

    // Find the entry point
    lpfnDllRegisterServer = (HCRET)GetProcAddress(hLib, "DllUnregisterServer");



    if (lpfnDllRegisterServer == NULL)
    {
		szError = NEWLINE;
		szError = ERR_PROCEDURE_ADDRESS;
		return false;            
    }

    // Call the function by function pointer..
    if (FAILED((*lpfnDllRegisterServer)()))            
    {   
		szError.Format(_T("\nWindows could not unregister context menu driver %s!"),szDllName);
		return false;            
    }

    FreeLibrary(hLib);

Open in new window


What is the best way to go about this to avoid this Windows error?
0
What are the advantages and disadvantages of pipes ,fifo's,threads,sockets,shared memory,message queue's.And which of them i s faster?
0
Can I assign co line 6 to a phone number as  part of system programming I want this a a 'panic' button to call a specific outside number
0
$check_email="select * form users where user email='$email'";
            $run_email = mysqli_query($con,$check_email);
      
            $check = mysqli_num_rows($run_email);
             
               if($check==1){
      
             echo "<script>alert('Email phone already exit,please try another!')</script>";
             exit();
0
I have recently learned C++ and C#. That is, I have taken courses to understand the basics of them and now want to start using them for professional work. I have said I want to take on projects that push me to learn a lot more about these vast programming languages. I have a hardware device name Griffin PowerMate. It is a USB knob/wheel that can be helpful controlling a computer. For some reason, it does not have great support on Window 7, 10. It does have a driver for Window XP and Vista. I cannot get this device to do what I want in Windows 10. However, on a Mac computer, the driver is up to date and does everything I want. So, to me this proves what I want on the Windows side is possible. Is it likely to think that without an SDK from the company I could use C++ or even C# to create a driver for this device?
0
Hello I found this code here
<html>
<head>

<script>
      var updateRate = 50;    // Lower number gives higher update rate
      var sizeChange = 0.25;  // Lower number gives smaller difference in fontsize per update
                var numberOfLines = 24; // Set this to the number of lines
</script>
<style>



.vline {font-size: 0; margin: 0}
.line {font-size: 0; margin: 0; display: none}
</style>

</head>
<body bgcolor="black" text="white" topmargin="0" leftmargin="0" rightmargin="0" bottommargin="0" scroll="no">

<div style="position: absolute; left: -100%; top: 20%; width: 300%; height: 80%; overflow: hidden; text-align: center">
<p id="p0" class="line"> </p>
<p id="p1" class="line"> </p>
<p id="p2" class="line"> </p>
<p id="p3" class="line"> </p>
<p id="p4" class="line"> </p>
<p id="p5" class="line"> </p>
<p id="p6" class="line"> </p>
<p id="p7" class="line">All lines about the same length</p>
<p id="p8" class="line">Gives the best result I believe</p>
<p id="p9" class="line">All lines about the same length</p>
<p id="p10" class="line">Gives the best result I believe</p>
<p id="p11" class="line">All lines about the same length</p>
<p id="p12" class="line">Gives the best result I believe</p>
<p id="p13" class="line">All lines about the same length</p>
<p id="p14" class="line">Gives the best result I believe</p>
<p id="p15" class="line">All lines about the same length</p>
<p id="p16" class="line">Gives the best result I believe</p>
<p id="p17" class="line">All 

Open in new window

0
I found this code very helpfull for my church site, but i would like to know if can add a loop so it repeat itself. Thank you
<html>
<head>

<script>
      var updateRate = 50;    // Lower number gives higher update rate
      var sizeChange = 0.25;  // Lower number gives smaller difference in fontsize per update
                var numberOfLines = 24; // Set this to the number of lines
</script>
<style>



.vline {font-size: 0; margin: 0}
.line {font-size: 0; margin: 0; display: none}
</style>

</head>
<body bgcolor="black" text="white" topmargin="0" leftmargin="0" rightmargin="0" bottommargin="0" scroll="no">

<div style="position: absolute; left: -100%; top: 20%; width: 300%; height: 80%; overflow: hidden; text-align: center">
<p id="p0" class="line"> </p>
<p id="p1" class="line"> </p>
<p id="p2" class="line"> </p>
<p id="p3" class="line"> </p>
<p id="p4" class="line"> </p>
<p id="p5" class="line"> </p>
<p id="p6" class="line"> </p>
<p id="p7" class="line">All lines about the same length</p>
<p id="p8" class="line">Gives the best result I believe</p>
<p id="p9" class="line">All lines about the same length</p>
<p id="p10" class="line">Gives the best result I believe</p>
<p id="p11" class="line">All lines about the same length</p>
<p id="p12" class="line">Gives the best result I believe</p>
<p id="p13" class="line">All lines about the same length</p>
<p id="p14" class="line">Gives the best result I believe</p>
<p id="p15" class="line">All …
0
I'm using currently the project
https://support.microsoft.com/de-de/help/246227/sample-secumgr-exe-overrides-security-manager-for-webbrowser-host
to check if a web portal, for example http://fontello.com/, works fine with EOT, WOFF and TTF to displaying different icons.

It looks like fonts with the Content-Type application/vnd.ms-fontobject or application/font-woff could not be used with IWebBrowser2.
In the webtraffic i could see, that the app could download the fonts, but after the download i received the error E_ABORT in the IHttpNegotiate::OnResponse handler.

The web pages works in IE, but when we disable font download in the security settings we get the same 'problem' with the IE.

I tried to enable the font download in function IInternetSecurityManager::ProcessUrlAction
(URLACTION_HTML_FONT_DOWNLOAD) without a positive result.

What i'm doing wrong?
0
Hi Experts,

I have written a program that reads the network interfaces to retrieve the MAC addresses for the network cards/interfaces in the computer.

The program sets up a http server to run locally on every machine, listening on a port for the API calls. For each request I'm starting a new thread, and in that thread I make a call to retrieve this information.

However, sometimes the program crashes entirely (not just the thread serving the request, but the entire program itself), without any logs or exceptions.

I'm not too sure what the cause is, but I suspect it may have to do with the NetworkInterface.GetAllNetworkInterfaces() call, as my logs stop there everytime it randomly crashes. Usually, even if a COMException occurs (due to some native DLL I'm using), the server would still be up and running, but in this case, the server closes entirely.

I have also tried this on my colleague's computer; it seems to be fine for him, but mine crashes randomly, perhaps once every 100 requests?

My question is, is there a known issue with the NetworkInterface.GetAllNetworkInterfaces() call? If not, is there a way for me to properly debug and find the cause of this issue?


Best Regards,
Zack
0
Hi experts, i want to change PHP to POWERBUILDER, any help please!
below the php script :

========encrypt===============
function mc_encrypt($data, $key)
{
/// make binary representasion of $key
$key = hex2bin($key);

/// check key length, must be 256 bit or 32 bytes
if (mb_strlen($key, "8bit") !== 32) {
throw new Exception("Needs a 256-bit key!"); }

// create initialization vector
$iv_size = openssl_cipher_iv_length("aes-256-cbc");
$iv = openssl_random_pseudo_bytes($iv_size);

/// encrypt
$encrypted = openssl_encrypt($data, "aes-256-cbc", $key, OPENSSL_RAW_DATA, $iv );

/// create signature, against padding oracle attacks
$signature = mb_substr(hash_hmac("sha256", $encrypted,  $key,   true),0,10,"8bit");

/// combine all, encode, and format
$encoded = chunk_split(base64_encode($signature.$iv.$encrypted));

return $encoded;
}

========decrypt===============
function mc_decrypt($str, $key)
{

/// make binary representation of $key
$key = hex2bin($key);

/// check key length, must be 256 bit or 32 bytes if (mb_strlen($key, "8bit") !== 32) {
throw new Exception("Needs a 256-bit key!"); }

/// calculate iv size
$iv_size = openssl_cipher_iv_length("aes-256-cbc");

/// breakdown parts
$decoded = base64_decode($str);
$signature = mb_substr($decoded,0,10,"8bit");
$iv = mb_substr($decoded,10,$iv_size,"8bit");
$encrypted = mb_substr($decoded,$iv_size+10,NULL,"8bit");

/// check signature, against padding oracle attack
0
What I need is to return a single partition ID by supplying a LABEL so I can use it in a bash script.

For instance partid = somecommand DATA-BU would store the partition is in a variable.  

What sayeth the group ?

Jay
 
I have seen ls -l /dev/disk/by-label will show me ALL LABELS > Partitions as shown in this picture, however I only need a single one and I need it in a variable form.

label-info.png
0
Hi,
How to adjust to list below, to have also one picture file included, that is retrieved from database?

            using (SqlConnection sqlConn = new SqlConnection(ConfigurationManager.ConnectionStrings["Mssqlconn3"].ConnectionString))
            {
                using (SqlCommand sqlCmd = new SqlCommand("SELECT house_name, address1, address2, price, price_curr FROM house_tab", sqlConn))
                {
                    sqlConn.Open();
                    sqlCmd.CommandType = CommandType.Text;
                    SqlDataAdapter sqlAd = new SqlDataAdapter(sqlCmd);
                    DataTable sqlDt = new DataTable();
                    sqlAd.Fill(sqlDt);
                    sqlConn.Close();
                    if (null != sqlDt)
                    {
                        houseList = sqlDt
                                        .AsEnumerable()
                                        .Select(dataRow => new HouseData
                                        {
                                            house_name = dataRow.Field<string>("house_name"),
                                            address1 = dataRow.Field<string>("address1"),
                                            address2 = dataRow.Field<string>("address2"),
                                            price = dataRow.Field<decimal>("price"),
                                            price_curr = dataRow.Field<string>("price_curr"),
                                        })
         

Open in new window

0
I referred to your post :
https://www.experts-exchange.com/questions/20930458/CreateProcess-for-Currently-Logged-On-User-from-Service-running-System-Account.html
and started building i got error in calling of
HANDLE GetCurrentUserToken()
{
      PHANDLE currentToken = 0;
      HANDLE primaryToken = 0;
      DWORD processID = GetExplorerProcessId();
      HANDLE hProcess = OpenProcess(PROCESS_ALL_ACCESS, TRUE, processID);
      if (!hProcess)
      {
            LogMessage(ErrorExit(TEXT("OpenProcess Error")));
      }
      if (!OpenProcess(PROCESS_ALL_ACCESS, TRUE, processID))
      {
            LogMessage(ErrorExit(TEXT("OpenProcess Error")));
      }
      if (!OpenProcessToken(GetCurrentProcess(), TOKEN_ALL_ACCESS, currentToken))
      {
            LogMessage(ErrorExit(TEXT("OpenProcessToken Error")));
      }

      if(!DuplicateTokenEx(currentToken,TOKEN_ASSIGN_PRIMARY | TOKEN_ALL_ACCESS,0, SecurityImpersonation, TokenPrimary, &primaryToken))
      {
            LogMessage(ErrorExit(TEXT("DuplicateTokenEx Error")));
      }

      return primaryToken;
}


Kindly Help me out
0
Hi all,
We are currently in the process of implementing a new financial system which needs to interfaces with several other business systems to process payments. i.e. the source system interfaces with new target financial system to send instruction on people/businesses that need to be paid.  I want to make sure that the details regarding these interfaces are suitably documented.
What I am struggling with in this regard is what we should be documenting.  Some research highlights different expectations and requirements e.g. interface strategies, interface designs, interface control documents, interface specification etc.

My question is what documents should we be creating for the new system as a whole, what documents we should be creating for each specific interface and what kind of information should be included in each?

Some thoughts I have had that we should be recording are:
•      Mapping tables
•      Validations
•      Ownership & Responsibilities
•      Security requirements
•      Data fields being interfaced
•      Interface method
•      Timings
•      How the interface will be processed
•      Reconciliations

TIA
0
Mohon bantuan nya
0
What is counting semaphore?
0
hi all, please i just installed this panasonic TDA 100 ip intercom telephone system. everything is working fine but i dont know how to programm the call assignment feature, unlike the  1232 where you can do the programming with the operator console. please is there a way to programm this(TDA100) intercom with operator console.
thank you all
0
Write a TSR program that will clear all the contents of the screen and write your ( SYSTEM PROGRAMMING) anywhere on screen of the video text memory available at 0xB8000000 whenever interrupt 8 is invoked.  Also, note that the fore color of SYSTEM PROGRAMMING should be white and back color should be blue.
0
Hello, I need help .. I would like to create Flash Drive (UEFI), which when run (bootable usb) clears all disks (except the USB disk with automated diskpart). (Diskpart -> select disk 1/2/3 and clean all). It would somehow create? Also, if I have the best flashdrive after launch could pull (stored in RAM) .. For example, .bat or .cmd format :) I need this flashdrive to simplify my work. :) Please help me with the creation of the USB flashdrive very please ..
0
The RMC return code is 0. The OS return code is 1140.




Edit: Topic changed from Visual Basic Classic to Unix OS
Graham Skan
0
I am trying to learn and then teach ARM processor and the assembly language. Can anyone point me to the correct direction to start with?  In particular I would like to know the best free simulators for ARM systems.
Thanks
0
Hello expert,
I would like setup netmap on ubuntu release 15. Thanks.
s.s.
0
How to append sysdate to file name in UNIX shell scripting  and remove the file .

Eg: file_name.CSV

Requirement: file_name_sysdate.CSV
File_name_yyyy-mm-dd.CSV
0
Hi,  we have a mitel 5000 system in one of our facilities.  I am trying to come up with a configurable way that we can make an extension ring though the paging system because it needs to let people on the plant floor know someone is calling.  I know I could open up a phone and solder on some wires to the speaker and attach it through the paging system... but before I plug in my soldering iron, I thought I would ask you find folks if you know of another way.

Thanks in advance!
0
I have an application that opens 1 RAW socket and 1 IP socket.  The RAW socket is used to send out VLAN-tagged UDP packets, and the IP socket is used to send out ICMP request packets.

Sockets are created as follows:
RAW - socket(AF_PACKET, SOCK_RAW, htons(ETH_P_8021Q);
IP      - socket(AF_INET, SOCK_RAW, IPPROTO_ICMP);

I can see that the ICMP request gets sent out properly.  But occasionally the UDP packets get sent out with an ICMP header wrapped around the UDP header, and most of the time they are sent out correctly.  So the packet looks like ETH-IP-ICMP-IP-UDP-PAYLOAD.

Is there any reasonable explanation for this?  Is there something that I can check within the code that may cause this to happen?
0

System Programming

40K

Solutions

19K

Contributors

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.

Top Experts In
System Programming
<
Monthly
>