windows

Duplicate file descriptor with its own file offset

How can one create a new file descriptor from an existing file descriptor such that the new descriptor does not share the same internal file structure/entry in the file table? Specifically attributes such as file offset (and preferably permissions, sharing and modes) should not be shared between the new and old file descriptors. Under b...

How to work with startup in windows application(.net)

i created a small tool in windows application using (.net language C#). i created setup for my tool and also when we click on minimize button it will be in system tray. My requirement is i want to place my tool in start up (start>All Programs>Start up) when i start my system automatically my tool is open this is my requirement please hel...

Active Wait in Windows I/O Driver

Continuing the question in: http://stackoverflow.com/questions/1587521/keep-windows-trying-to-read-a-file Thanks to accepted answer in that question I realized that keeping windows waiting for data is a driver responsability. As i'm using Dokan, I am be able to look into the driver code. Dokan complete the IRP request with a STATUS_EN...

Is there a Windows hook for when the internet is connected/disconnected?

Possible Duplicate: Is there a Windows hook for when the internet is connected/disconnected? I could do an endless timer checking IsInetOffline(), but I would prefer a hook callback that tells me when I plug/unplug the ethernet network cable or connect to wireless internet. Is there such a thing in the Windows API? ...

Can we Change the Value of ComponentsLocation from "Relative" to "HomeSite"???

hii, well i develop a setup.exe(bootstrapper) using GenerateBootstrapper.Bootstrapper to load my msi file after check and installing prerequisites.It perfectly running if i make ComponentsLocation *) either "HomeSite" to download prerequisites from the microsoft and install. *) or "Relative" to take the prerequisites at the same locat...

Time limited trial and Windows Certification

If you want to implement a time limited trial for an application you would probably want to leave behind some flag (registry key, file etc) so a program couldn't just be re-installed. Are there any schemes that allow you to do this while still passing the various Windows Certification programs? Generally :- Applications must correc...

Batch/Windows: Random Numbers.

Hello, I am developing a card game for batch. [will give a link when done] Basiclly what i want to do is 'set' '%random%' to '%numbs%. set %numbs%=%random% And then i want the user to type one value from the %random% numbers displayed echo %numbs% Set nuchoo= set /p nuchoo=Number: What my question now is about how to check if the...

In Windows, how can one create a child process and capture its stdin, stdout, and stderr, without duplicating any inheritable handles?

There are at least three parts to this problem, so bear with me: 1) CreateProcess has a parameter bInheritHandles, that causes the child process to inherit all of the inheritable handles in the parent process. This option must be set to TRUE to allow the parent to specify stdin, stdout, and stderr handles for the child in the STARTUPINF...

Async operations with I/O Completion Ports return 0 bytes transferred

Asynchronous operations with I/O Completion Ports return 0 bytes transferred, although the I/O operations work as expected (my read buffers become full). BYTE buffer[1024] = {0}; OVERLAPPED o = {0}; HANDLE file = CreateFile( _T("hello.txt"), GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_FLAG_OVERLAPPED...

Windows Media Player on top other DIV

I have an embed window media player which is always on top of other DIV tags. I used wmode = opaque; WindowlessVideo = -1 but it does not help. Does anyone know how to make it appear below a certain element of the page. <object type="application/x-oleobject" classid="CLSID:6BF52A52-394A-11D3-B153-00C04F79FAA6" codebase= "http://activex....

C#: What is the fastest way to generate a unique filename?

I've seen several suggestions on naming files randomly, including using System.IO.Path.GetRandomFileName() or using a System.Guid and appending a file extension. My question is: What is the fastest way to generate a unique filename? ...

Drupal Development on a Thumb Drive

I mostly a .NET developer but need to do some new work in Drupal. So I guess I need a portable - Apache - PHP - MySQL - phpMyAdmin - Drupal codebase What is the best way to work with the environment on a portable / thumb drive? I'm on Windows. I want to go portable because I work on 3 to 4 different machines throughout the week. Is...

Controlling PerfMon logging on multiple systems

I need to use PerfMon to collect data from several machines, and I need to be able to turn collection on/off at certain times. I've got all the data points configured on each machine; I just need to start/stop PerfMon, and to start/stop collection of a set of data points. For reasons I won't go into, I can't simply configure all collec...

Obtain the domain name on a workstation or server

Some systems don't have a domain name configured or they might have something in the form of domain.local; yet they are located within a domain. Is there a way to get the domain these system belong to? I already tried using the classic APIs: NetWkstaGetInfo() DnsQueryConfig() and many others... Code is appreciated. ...

kill subprocess when python process is killed?

I am writing a python program that lauches a subprocess (using Popen). I am reading stdout of the subprocess, doing some filtering, and writing to stdout of main process. When I kill the main process (cntl-C) the subprocess keeps running. How do I kill the subprocess too? The subprocess is likey to run a long time. Context: I'm launchi...

Sharepoint 2007 on Windows 2008

I wanted to get some feedback about the problems we might face if we deploy Sharepoint 2007 on Windows 2008 instead on windows 2003 ...

Elevating a process to run as admin doesn't work

Elevating a process to run as admin doesn't work. If I run that application from an elevated command prompt it runs fine. But my code below doesn't. Process setupws = new Process(); setupws.StartInfo.FileName = @"setupws.exe"; setupws.StartInfo.Verb = "runas"; setupws.StartInfo.UseShellExecute = true; setupws.Start(); setupws.WaitForEx...

Creating Windows DLL from C++ source files

I have multiple source files in C++ using which i want to create a Dynamic link library. I see this happening in linux with gcc -shared and ln however for Windows i suppose i would have to modify source files to generate a DLL. Is there a way to generate DLL (a file similar to *.so in linux) with provided source files. Please correc...

Buffer overflow - Windows vs Unix

I'm trying to figure out the security concerns between buffer overflows in Windows vs Unix. As I understand it, the buffer overflow Windows hack cannot be implemented in Unix because each process is given it's own memory space. Does this mean that processes in Windows share memory space? ...

Is there a way to hook or intercept CoGetClassObject and/or CoCreateInstance calls?

I'd like to intercept the COM CoCreateInstanceEx and/or CoGetClassObject functions to replace a class with a testing shim in a unit test. This will only be for a single CLSID; all others can go through unchanged. Is there a way to do this without horrible, evil hacks? ...