Windows error 0x0000FFFF, 65535

Detailed Error Information

HRESULT analysis[1]

This is probably not the correct interpretation of this error. The Win32 error above is more likely to indicate the actual problem.
FlagsSeveritySuccess

This code indicates success, rather than an error. This may not be the correct interpretation of this code, or possibly the program is handling errors incorrectly.

Reserved (R)false
OriginMicrosoft
NTSTATUSfalse
Reserved (X)false
FacilityCode0 (0x000)
NameFACILITY_NULL[1][2]
DescriptionThe default facility code.[1][2]
Error Code65535 (0xffff)

Questions

21votes
5answers

How to efficiently de-interleave bits (inverse Morton)

This question: How to de-interleave bits (UnMortonizing?) has a good answer for extracting one of the two halves of a Morton number (just the odd bits), but I need a solution which extracts both parts (the odd bits and the even bits) in as few operations as possible. For my [...] read more
bit-manipulation
z-order-curve
15votes
3answers

Changing master volume level

How can I change the master volume level? Using this code [DllImport ("winmm.dll")] public static extern int waveOutSetVolume (IntPtr hwo, uint dwVolume); waveOutSetVolume (IntPtr.Zero, (((uint)uint.MaxValue & 0x0000ffff) | ((uint)uint.MaxValue << 16))); I can set the wave volume but if the master volume is too low this won't have any effect. [...] read more
c#
winapi
volume
9votes
1answer

Should using MOV instruction to set SS to 0x0000 cause fault #GP(0) in 64-bit mode?

This question is inspired by a Reddit question in r/osdev except that this question focuses on the SS register. One may say RTFM (ISA entry for MOV), but when this question comes up it can get varying answers even among OS developers. -------------------------------------------------------------------------------- Question: Should using the MOV instruction to [...] read more
assembly
64-bit
x86-64
nasm
osdev
8votes
2answers

Problem switching to v8086 mode from 32-bit protected mode by setting EFLAGS.VM to 1

I'm in 32-bit protected mode running at current privilege level (CPL=0). I'm trying to enter v8086 mode by setting EFLAGS.VM (Bit 17) flag to 1 (and IOPL to 0) and doing a FAR JMP to my 16-bit real mode code. I get the current flags using PUSHF; set EFLAGS.VM (bit [...] read more
assembly
x86
nasm
x86-64
osdev
7votes
4answers

C Programming TCP Checksum

I have been having trouble doing the checksum for TCP for several days now. I have looked at many sources on the Internet but none of the examples that I have seen show you how to do the TCP checksum. I have also looked at the RFC document and still [...] read more
c
tcp
checksum
raw-sockets
7votes
1answer

How to setup ARM interrupt vector table branches in C or inline assembly?

Can someone please show me an example of how to setup an ARM9 interrupt vector table using C or inline assembly in a bare-metal environment with no RTOS or Linux OS? Specifically how can I use inline assembly or C to set branches to my IRQ interrupt handler ISR coded [...] read more
embedded
arm
interrupt
bare-metal
7votes
5answers

Sign extension from 16 to 32 bits in C

I have to do a sign extension for a 16-bit integer and for some reason, it seems not to be working properly. Could anyone please tell me where the bug is in the code? I've been working on it for hours. int signExtension(int instr) { int value = (0x0000FFFF & [...] read more
c
binary
integer
sign
6votes
1answer

Solution needed for building a static IDT and GDT at assemble/compile/link time

This question is inspired by a problem many have encountered over the years, especially in x86 operating system development. Recently a related NASM question was bumped up by an edit. In that case the person was using NASM and was getting the assemble time error: > shift operator may only [...] read more
assembly
x86
nasm
ld
osdev
5votes
0answers

In a MIPS assembly `addi` instruction, how is a hexadecimal immediate interpreted?

Is there is a standard or recommendation for how the addi instruction (and others) should be interpreted in assembly, when hexadecimal immediate values are used? Example: addi $t0, $zero, 0xffff I was expecting this to mean the same as addi $t0, $zero, -1 where 0xffff would be sign extended to [...] read more
assembly
mips
mars-simulator
spim
immediate-operand
5votes
5answers

Count the consecutive zero bits (trailing) on the right in parallel: an explanation?

Consider this link from the Bit Twiddling Hacks website. In order to count the trailing bits, the following algorithm is used: unsigned int v; // 32-bit word input to count zero bits on right unsigned int c = 32; // c will be the number of zero bits on the [...] read more
c++
algorithm
c++11
bit-manipulation
5votes
2answers

Is it possible to make `=` prefer assignment-from-conversion over (deleted) copy-assignment?

I've found a few threads that heavily imply this can't be done, but none use exactly the same combination of operators and conditions, so I'd like to ask more specifically. Hopefully that means it's a quick and easy answer for someone... one way or another! Consider an example proxy class, [...] read more
c++
implicit-conversion
copy-assignment
standard-layout
5votes
2answers

Getting large drive structure information in DOS 7.x

I wrote a directory information utility and (because I, and the people I wrote this for collect & use vintage hardware,) made it compatible with DOS and Windows 9x as well as Windows XP/Vista/7/8 64-bit (because we also use those.) The problem I ran into was with Windows 9x and [...] read more
c++
assembly
dos
4votes
1answer

Raku: How do I assign values to CArray[WCHAR]?

$ raku -v This is Rakudo version 2019.07.1 built on MoarVM version 2019.07.1 The following was done on Raku REPL. What am I doing wrong here? How do I assign values to CArray[WCHAR]? I want $lpData[0] to be 0xABCD and $lpData[1] to be 0xEF12. > use NativeCall; Nil > constant [...] read more
raku
nativecall
4votes
1answer

Weird problem on STM32 ADC with Interleaved Mode

I am sampling a signal on STM32F3 Discovery board (stm32f303vct6) with two ADCs working in interleaved mode. It works great with a 200kHz 1V sine wave. But when I apply 10kHz 100mV sine wave, I see some interesting patterns. ADCs seem to convert all the voltage levels in a specific [...] read more
c
arm
embedded
stm32
adc
4votes
5answers

Efficiently dropping 2 bits from a 32bit data type

Assume you have a 32bit data type: // The letters are just to identify the position of each bit later in the post abcdefgh ijklmnop qrstuvwx yzABCDEF I'm logging for the most efficient way to "drop" bits at certain locations, where dropping means "removing" the given bits, and moving the [...] read more
c++
algorithm
bit-manipulation
4votes
4answers

Extract upper and lower word of an unsigned 32-bit integer

To extract the upper and lower word of an unsigned 32-bit integer and store each one in separate uint16_t-variables I do as follows (nbr is an unsigned 32-bit integer): uint16_t lower_word = (uint16_t) nbr & 0x0000FFFF; // mask desired word uint16_t upper_word = (uint16_t) ((nbr & 0xFFFF0000) >> 16); // [...] read more
c
word
uint32
uint16
3votes
0answers

ActivityResultLauncher successfully launch the ActivityResultContracts the first time on AppCompatActivity , but crashes at the second time

What I am using is the new features of androidx.activity: activity_version = "1.2.0-alpha06" implementation "androidx.activity:activity:$activity_version" Assume that there is a button. When I click it, it displays the images directory, and I can select several images at a time. After confirming the selection, I get a list of uris of [...] read more
android
android-activity
3votes
4answers

How to reverse bits in a bitset?

For example, I have the integer a = 10; and it's binary representation (for a 32 bit integer) is 00000000000000000000000000001010 and reversed, it becomes 01010000000000000000000000000000 Now I've seen this code, from this topcoder article that can accomplish this x = ((x & 0xaaaaaaaa) >> 1) | ((x & 0x55555555) << [...] read more
c++
c++11
bits
bitset
2votes
1answer

Multiboot keyboard driver triple faults with GRUB (works with QEMU) - why?

I've been reading a ton of tutorials about OS development on x86, and so far all has gone well - until now. I can't figure out what the solution is for the life of me. My goal is to write the simplest possible keyboard driver for x86. Things work well [...] read more
gcc
x86
kernel
interrupt
osdev
2votes
1answer

Unique Number generation based on latitude and longitude in Java and Python

I am trying to implement unique number generation based on latitude and longitude such that for same latitude and longitude pair the number generated should be same. Other than that generated number should not exceed the maximum value of Integer in Java, which is 2147483647 Following python function is working [...] read more
java
python
latitude-longitude
2votes
1answer

Code works in Release mode, but throws error in Debug configuration

I put together the code for a system wide keyboard shortcut that I got from @Chris Taylor. I wanted it to work in .NETCoreApp 3.0 because according to MS docs, System.Windows.Forms.dll is supported I added a reference to System.Windows.Forms.dll located at C:\Windows\Microsoft.NET\Framework64\v4.0.30319 (older versions worked too). At this point the [...] read more
c#
.net-core
2votes
0answers

Roundcube - Uncaught ArithmeticError: Bit shift by negative number

I have install dovecot, postfix and roundcube but roundcube logs give the this Error: [12-Nov-2019 21:23:08 UTC] PHP Fatal error: Uncaught ArithmeticError: Bit shift by negative number in /usr/share/roundcube/program/lib/des.inc:155 Stack trace: #0 /usr/share/roundcube/program/lib/des.inc(39): des_createKeys('rcmail-!24ByteD...') #1 /usr/share/roundcube/program/lib/Roundcube/rcube.php(815): des('rcmail-!24ByteD...', 'my_pass\x80', 1, 1, '\xF5|L^c\x9ESb') #2 /usr/share/roundcube/program/include/rcmail.php(630): rcube->encrypt('my_pass\x80') #3 /usr/share/roundcube/index.php(108): rcmail->login('username', 'my_pass', 'localhost', true) [...] read more
php
php-7.2
dovecot
roundcube
2votes
1answer

Why does my canvas noise function always only appear red?

I'm trying to apply a noise effect to my canvas, based on a codepen I saw, which in turn appears to be very similar to an SO answer. I want to produce a "screen" of randomly transparent pixels, but instead of that I get a field that's completely opaque red. [...] read more
javascript
canvas
typed-arrays
putimagedata
2votes
2answers

How to break the file number [64K] limit when building an apk?

There are over 64K files in the assets folder in my Android Project, which caused IllegalArgumentException: Value(66049) > 0x0000ffff Details about Exception when building apk org.gradle.execution.MultipleBuildFailures: Build completed with 1 failures. at org.gradle.initialization.DefaultGradleLauncher$ExecuteTasks.run(DefaultGradleLauncher.java:358) at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:300) at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:292) at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:174) at org.gradle.internal.operations.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:90) at org.gradle.internal.operations.DelegatingBuildOperationExecutor.run(DelegatingBuildOperationExecutor.java:31) at org.gradle.initialization.DefaultGradleLauncher.runTasks(DefaultGradleLauncher.java:219) at org.gradle.initialization.DefaultGradleLauncher.doBuildStages(DefaultGradleLauncher.java:149) at org.gradle.initialization.DefaultGradleLauncher.executeTasks(DefaultGradleLauncher.java:124) at [...] read more
android
package
2votes
2answers

Determining if an Int Fits into a Short in C using Bitwise Operators

I am tasked with making a function that returns whether or not an int x fits into a short in C (return 1 if it does, 0 otherwise). This would normally be a fairly simple solution, but I'm constrained to using only the following bitwise operators:! ~ & ^ | [...] read more
c
binary
int
bit-manipulation
2votes
1answer

How can I trace the cause of an invalid PC fault on Cortex M3?

I have an STM32 Cortex M3 that is experiencing an intermittent invalid PC (INVPC) fault. Unfortunately it takes a day or more to manifest and I don't know the cause. I have the device paused in the debugger after the fault happened. The INVPC flag is set. The stacked registers [...] read more
arm
1vote
0answers

pci no space error

I have a Xilinx FPGA pcie card (vcu1525) and programmed it to have 2 BAR which defines 64KB and 4MB memory spaces. 02:00.0 Serial controller: Xilinx Corporation Device 903f (prog-if 01 [16450]) Subsystem: Xilinx Corporation Device 0007 Physical Slot: 4 Control: I/O- Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR+ [...] read more
drivers
pci-express
pci
1vote
1answer

How to set up dual quadro cards on RHEL 5.5?

I have a RHEL 5 workstation with 2 nvidia Quadro FX4500 cards, with one display attached to each card. After doing a clean install of RHEL 5.5, the second display doesnt work (it worked ok in RHEL 5.2). Neither separate X screens nor Xinerama are working. The kernel version is [...] read more
multiple-monitors
redhat-enterprise-linux
nvidia-quadro
1vote
1answer

xorg.conf: Why does this have no effect?

Here is my xorg.conf file. The problem is that my resolution setting 1600x900 is getting ignored. The resolution keeps popping to 1280x1024 Edit The resolution comes up as 640x480 after unplugging the physical monitor. When my file gets ignored, the system seems to read my monitor to find it's capabilities [...] read more
resolution
xorg.conf
solaris-10
1vote
1answer

Reversing a hash to find something which works, but hashcat seems to have issues

I saw some unfamiliar code on a project i was working on. I saw a function which said: var salt = 1514691869198; var result hex_hmac_sha1(salt, hmac_sha1(password)) # result is: 462435F34EAD6BB7C70751D90984DADD90EED9A4 I was having some issues with hashcat though. It seems to be getting killed early because of a driver or [...] read more
hash
passwords
password-encryption
1vote
1answer

Unexpected behavior from glVertexAttribPointer data types using pyglet

I've been working on implementing a quadtree based LOD system. I'm using Pyglet as a python binding for OpenGL and I'm getting some weird behavior, I'd like to know if I'm doing something wrong. Setting up my buffers: (input data are leaves of a quadtree to be decoded in the [...] read more
python
opengl
glsl
shader
pyglet
1vote
0answers

Hashing quality not constant over bits

I am attempting to derive a pseudo-random 32bit value from a 32bit input. For this, I am using this murmur hash: uint32_t murmur(uint32_t key, uint32_t seed) { uint32_t k = ( key ^ seed ) * 0x5bd1e995; k = k ^ (k>>24); return k; } To my surprise, there is [...] read more
random
murmurhash
1vote
0answers

A series of problems when setting CR0_PGbit

> My native language is not English. Please forgive me if I offend you or make > mistakes in wording The Qemu screen is twinkle When I try to setup CR0_PG bit to enable memory paging function And The PF flags is up I open GDB to view the valve [...] read more
assembly
x86
x86-64
nasm
osdev
1vote
3answers

andi vs. addi instruction in MIPS with negative immediate constant

Assume $t2=0x55555550, then executing the following instruction: andi $t2, $t2, -1 $t2 becomes 0x0005550 This is confirmed by the MIPS emulator1 However, it is not what I expected. I think the answer should be 0x55555550 & 0xFFFFFFFF = 0x55555550. I think the constant -1 was sign extended to 0xFFFFFFFF before [...] read more
assembly
mips
sign-extension
zero-extension
immediate-operand
1vote
0answers

Weird behavior about my fragment and activity

I have an application that reads NFC tags (when main button in MainActivity is clicked), then displays the result in a modal. It works well but know, what I'd like to do is create a fragment to use ViewPager (to have nice transition on my future fragments). But now, at [...] read more
android
android-fragments
android-viewpager
1vote
2answers

I have created a Fragment but don't know what to put inside

I have realised an NFC (to scan tags) application, but now I have to create fragment who works with my MainActivity because I'd like to implement ViewPager in future. Problem is that i'm really beginner and my code became too big to know what I have to put in Activity [...] read more
android
android-fragments
android-activity
1vote
1answer

NSIS Get Product Version

I am trying to get the ProductVersion using NSIS 2.49. Does anyone have examples on how to get the product version? GetDllVersion "C:\data\Some.exe" $R0 $R1 ;the two values were read during compilation IntOp $R2 $R0 / 0x00010000 IntOp $R3 $R0 & 0x0000FFFF IntOp $R4 $R1 / 0x00010000 IntOp $R5 $R1 [...] read more
nsis
1vote
1answer

MARS Mips Adding more than 2 registers/printing solution

I did a few calculations (not even sure if they're remotely close to accurate as the instructions for the assignment are non existent (thanks worthless professors)) but basically I'm trying to take the value of $t2, $t3, $t4, and $t5.. add them together, then store them in $t6 and print [...] read more
assembly
integer
mips
add
1vote
0answers

Explanation of st_flags bits

I'm writing a python script to delete files on MacOS, and I run into SIP protected files. I know the presence of st_flags more than likely mean I can't delete the file. Like here: >>> os.stat(f).st_flags 524288 But I'm curious to know what that actually means. I looked in stat.h [...] read more
objective-c
linux
macos
file
unix
1vote
0answers

Counting 1's and 0's in a bit sequence

These two methods are from Hacker's Delight. I wish to count the number of 0's and 1's in a bit sequence. For example, for the following sequence 00000000000000000011011100111101 , I thought after removing the leading zeros I would get: * 2 Ones * 1 Zero * 3 Ones * 2 [...] read more
java
bit
1vote
0answers

Bare bones kernel throws Invalid Opcode Exceptions and General Protection Fault Exceptions

I was following this guide in trying to build a small kernel. I used it to write a small bootloader in assembly which eventually loads and runs C code. I've tried to implement basic interrupt-handling and following this other tutorial but my interrupt handling doesn't seem to work and it [...] read more
gcc
x86
kernel
nasm
osdev
1vote
0answers

How to make my MIPS program more register efficient and readable

This is the C++ code I am trying to convert to MIPS with int count_painted(int *wall, int width, int radius, int coord) { int row = (coord & 0xffff0000) >> 16; int col = coord & 0x0000ffff; int value = 0; for (int row_offset = -radius; row_offset <= radius; row_offset++) [...] read more
c++
performance
assembly
mips
cpu-registers
1vote
1answer

Bochs does not support AH=42h on INT 13h on disk boot option

Hi I'm doing boot loader with LBA addressing on Bochs. When executing int 13h with AH = 42h, the terminal displayed the following information. 00017480939i[BIOS ] int13_diskette: unsupported AH=42 00017481022i[XGUI ] charmap update. Font is 9 x 16 Next at t=17481022 The registers before int 13h instruction are as follow: [...] read more
operating-system
bootloader
bios
bochs
1vote
0answers

How to print 80-bit double extended precision floating point number in assembly x8086?

I'm working on a homework assignment, and want to print a 80-bit double extended precision number via printf. The number is calculated by some scaling function and using gdb i see it calculates the right number. I point to the block of 10 bytes using a some pointer named var1 [...] read more
assembly
x86
1vote
5answers

optimize 32-bit value construction

So, I have the following code: uint32_t val; if (swap) { val = ((uint32_t)a & 0x0000ffff) | ((uint32_t)b << 16); } else { val = ((uint32_t)b & 0x0000ffff) | ((uint32_t)a << 16); } Is there a way to optimize it, and have swap checking somehow embedded in the statement? read more
c
optimization
bit-manipulation
1vote
1answer

STM32F3 Dual ADC with interleaved mode

I'm trying to achieve 10MSPS as documented in STM32F30x ADC modes and application under the section Dual interleaved mode. Firstly, i tried to use single DMA. I configured the DMA1 Channel1 to read from ADC1&2 Common data register. It worked but i could only achieve a sample rate of 8.47MSPS. [...] read more
embedded
stm32
sampling
dma
1vote
1answer

Convert float type to two short (high & low bytes)

I transfer data through serial port. on decoding side. I'm coding on transferring side follow the code from receiving side. I must encode data from float type (4 bytes) to high part and low part (short type) then transfer them. I had the decoding code. What i must do on [...] read more
c++
arrays
decode
encode
converters
1vote
0answers

Boost Process fails on Solaris 10 in async mode

I am using boost process in async mode to run shell commands from a C++ application. The following code works well in Linux (CentOS 7 in my case), but fails on Solaris 10. On Solaris 10, the return code is 127 and stdout and stderr are empty. #include <iostream> #include [...] read more
c++
c++11
solaris-10
boost-process
1vote
1answer

Setting up the ATSAM3X8E on Arduino Due for SPI Slave Operation

I'm trying to build up a communication between Raspberry Pi 3B+ and Arduino Due via SPI. I have chosen the Raspberry Pi to act as master and the Arduino as slave. Therefore I have written some C Code for the Raspberry that configurates the interface and sends two byte of [...] read more
raspberry-pi
spi
slave
arduino-due
1vote
0answers

Bare metal audio output on Raspberry Pi3 working in AARCH64 asm but not the C version

I have been trying to write a bare metal kernel for over a year now and I am up to the point where I am ready to start working on audio output. I have written the code in asm however since I'm not great at it I'm not sure how [...] read more
c
assembly
raspberry-pi3
arm64
bare-metal
1vote
1answer

u-boot: how to access 'bootcount' from linux userspace?

I'm trying to use u-boot's "bootcount" feature to detect multiple failed attempts to boot, on a TI am335x device (e.g. beaglebone black.) On TI/ Davinci platform, the bootcount value is stored in the RTC_SCRATCH2 register (source). However on the linux side, I can't find any driver that exposes bootcount as [...] read more
c
beagleboneblack
u-boot
1vote
3answers

C# reversing the bits of an integer

I know this has been asked in similar variances many times, but I'm having trouble with the output of bitwise operations in C#(Unity3D). I'm trying to do bit-reversal permutation, that is, get the bit-reversed order of integers(or unsigned int, either one) for the purpose using in the Cooley-Tukey FFT algorithm. [...] read more
c#
bit-manipulation
1vote
1answer

Get current active Language keyboard

I want get active language keyboard for get active language i use this function : WCHAR name[256]; GUITHREADINFO Gti; ::ZeroMemory(&Gti, sizeof(GUITHREADINFO)); Gti.cbSize = sizeof(GUITHREADINFO); ::GetGUIThreadInfo(0, &Gti); DWORD dwThread = ::GetWindowThreadProcessId(Gti.hwndActive, 0); HKL lang = ::GetKeyboardLayout(dwThread); LANGID language = (LANGID)(((UINT)lang) & 0x0000FFFF); // bottom 16 bit of HKL is LANGID LCID [...] read more
c++
winapi
1vote
1answer

TIMER 32-bit on pic32 can't use interrupts

Hi I have a PIC32MX370F512L from microchip. I want to use TIMER2 and TIMER3 as a 32-bit timer for interrupts. I CAN use 16-bit Timer interrupt but CAN'T use 32-bit Timer interrupt, I will show you both codes: 16-bit timer: void init16(){ T2CONbits.ON = 0; //Timer disabled T2CON = 0; [...] read more
c
timer
embedded
microcontroller
microchip
0votes
1answer

Apache start script dumping core

Operating system: Solaris / SunOS. When starting Apache2.x using: ./apachectl start the following error is printed to the terminal: Illegal Instruction - core dumped Any idea what could be causing this or are there any logs I can inspect? More info:: out put from /bin/sh -x ./apachectl start : + [...] read more
apache-2.2
solaris
sun
0votes
0answers

WIFI 6 Card not working even though the computer detects it and up to date drivers are installed

I have run into a dead end here. I am trying to install an Intel AX200 WIFI + Bluetooth network card onto my desktop PC. I connected it to a PCIe port that had more slots than needed but I read that this should be fine. Additionally, a cable from [...] read more
wireless-networking
drivers
network-adapter
computer-building
0votes
0answers

Hashcat i5 3470 opencl error clCreateContext(): CL_DEVICE_NOT_AVAILABLE

I have an Intel i5 3470 cpu and I am running Ubuntu 16. I downloaded the last version of Intel OpenCL (Intel® CPU Runtime for OpenCL™ Applications 18.1 for Linux* OS (64bit only)) and Hashcat. I installed OpencCL without errors. When I run hashcat I get this error: hashcat (v5.1.0) [...] read more
cpu
hashing
opencl
0votes
2answers

RegGetValueA hard crashing application using luajit ffi

I am trying to use the RegGetValueA() from the Windows API , but so far I've been unable to get any results from it. At best, I get a "file not found" error, and at worst it crashes hard without any error messages at all. Below is the current code [...] read more
winapi
lua
ffi
love2d
luajit
0votes
0answers

Why am i getting error in make install in libsub?

Amirul Akmal@ASZK ~/libusb-master $ make install Making install in libusb make[1]: Entering directory `/home/Amirul Akmal/libusb-master/libusb' CC core.lo CC descriptor.lo CC hotplug.lo CC io.lo CC strerror.lo CC sync.lo CC os/events_windows.lo CC os/threads_windows.lo RC libusb-1.0.lo CC os/windows_common.lo os/windows_common.c: In function 'windows_error_str': os/windows_common.c:68:30: error: 'FACILITY_SETUPAPI' undeclared (first use in this function) error_code = [...] read more
makefile
mingw
libusb
0votes
1answer

Why does using char math result in unexpected results in C++?

I have a function that I am having a hard time understanding how the math is being performed: unsigned long Fat_AuthAnswer(char b1, char b2, char b3, char b4)` { unsigned char* ptr = NULL; unsigned short StartCRC = b1 + b2*256; unsigned long ret = crcbuf(StartCRC, b3, &AuthBlock[b4]); ret = [...] read more
c++
math
char
unsigned
0votes
0answers

IMediaObject.ProcessOutput returning S_FALSE

I am trying to write a simple audio capturing application in c++. and i found it is a very hard job to capture audio using c++ library, i couldn't find no more than a few library and I came up with ImediaObject. I found everything is okay in some other [...] read more
c++
windows
visual-studio
audio
audio-recording
0votes
1answer

Hashcat doesn't recover passwords, though they are present in the dict

I'm trying to do to a test launch of hashcat with these two passwords: $ echo "Password" | md5sum | tr -d ' -' >> target_hashes.txt $ echo "HELLO" | md5sum | tr -d ' -' >> target_hashes.txt $ ls rockyou.txt target_hashes.txt $ cat target_hashes.txt 29f33cab54c2a8858885b95d8fbb7ff1 0084467710d2fc9d8a306e14efbe6d0f $ hashcat -a [...] read more
linux
hash
passwords
hashcat
0votes
1answer

Choosing A Random IP From Any Specific CIDR Range In C

I am trying to create a function that'll be able to parse any IP/CIDR range and choose a random IP within this specific range as a string in C (including a /32, which would just return the single IP address each time). As of right now, I'm fine with it [...] read more
c
networking
cidr
0votes
0answers

MIPS- "Dropped off Bottom"?

I am a beginner in MIPS and I need to write a code that will draw a box on the bitmap display using 4 loops for each side of the box, the box should have the marquee effect and have a 5 ms delay. And it should have keyboard funtionality [...] read more
mips
0votes
0answers

Packing and retrieving packed bitfields

I'm interested in what the suggested way is to pack a value and retrieve that packed value again. I think to do this from a memory address -- if I'm understanding correctly -- is trivial, as you can retrieve the value based on the memory offset. Is that correct, or [...] read more
assembly
x86
bit-manipulation
bit-fields
0votes
0answers

C Structs mnemonics in Linux Socket Filter. trying to make sense

I am trying to discover details about C Linux Socket filter or C Linux BPS sockets. The network filter for socket on this link and other places on this link https://www.kernel.org/doc/Documentation/networking/filter.txt is something like this /* From the example above: tcpdump -i em1 port 22 -dd */ struct sock_filter code[] [...] read more
c
linux
networking
firewall
raw-sockets
0votes
0answers

Best way to reduce a pair of integers while maintaining their ratio

I'm running on a platform with no floating-point support, and the largest integer type being 32 bits. Given a pair of values, I need to ensure that none of them exceeds 16 bits before I continue to process them. If either one of them does, then I need to reduce [...] read more
c
0votes
1answer

Why does the loop direction of my filter change my result?

I have designed a simple dual channel filter to remove some noise at a given frequency. #include "../include/Filter.h" void Filter(int DataIn, int* DataOut, bool Enable) { static coef_t Coefficients[] = { 0.0076925293, -0.039817952, 0.018740745, 0.013075141, -0.052312399, 0.052374545, 0.017044802, -0.14227364, 0.26541378, 0.68194015, 0.26541378, -0.14227364, 0.017044802, 0.052374545, -0.052312399, 0.013075141, 0.018740745, -0.039817952, 0.0076925293 [...] read more
c++
vivado
vivado-hls
0votes
0answers

How to STR a value larger than #0x00FF into memory

I'm working with an FPGA that has a 40-pin bidirectional parallel port. To set the direction of the pins, I need to change the value of memory location 0xFF200074 to 0x0000FFFF. However, when I try to MOV #0x0000FFFF into a register, I get an error saying it's too large. I'm [...] read more
assembly
arm
0votes
3answers

Getting wrong values when I stitch 2 shorts back into an unsigned long

I am doing BLE communications with an Arduino Board and an FPGA. I have this requirement which restraints me from changing the packet structure (the packet structure is basically short data types). Thus, to send a timestamp (form millis()) over, I have to split an unsigned long into 2 shorts [...] read more
python
c++
arduino
0votes
0answers

RX Fifo1 for CAN is not generating an interrupt callback (basically it is not receiving the data)

There are two types of messages on the CAN bus. Those are broadcast message and default message. Currently, I'm using fifo0 for both the message(which works perfectly fine). But I would like to use fifo1 specially for broadcast message. Below is my initializing code uint8 BspCan_RxFilterConfig(uint32 filterId, uint32 filterMask, uint8 [...] read more
embedded
stm32
fifo
can-bus
iar
0votes
1answer

Too late to create Fragments?

I am working on my first Android application. I just came to discover Fragments and I need them to create a ViewPager to create nice transitions between my activities, but I fear that it's too late to implement that. I have to put all my code (MainActivity) in my MainFragment? [...] read more
android
android-viewpager
fragment
0votes
1answer

Bug in Heap Sort with Linked List

I'm writing a Heap Sort algorithm for a Linked List in C# and have encountered a bug that I cannot seem to solve. Basically what happens is instead of sorting the list properly, it duplicates some elements and removes others. The result is a list of the same length as [...] read more
c#
linked-list
heapsort
0votes
1answer

How do I target my random colour variable in my IF statement?

I have a question that is leading from the chosen best answer from my previous post: How can I use randomisation to specify different object parameters to a single iteration in a loop? I'm new to stack and wasn't sure of the best way to reference that post. I have [...] read more
java
javafx
0votes
0answers

How can I read the request posted file in IIS module?

I wrote an IIS module and it's working fine. I want to get the posted file from request. In below code, I could get sent form data and view the file in header: IHttpRequest * pHttpRequest = pHttpContext->GetRequest(); if (pHttpRequest != NULL) { LPCSTR body; DWORD cbBytesReceived = 1024; void [...] read more
c
iis-modules
0votes
0answers

Assembly language addw vs addw vs

What does the suffix refer to? The size of the source value, the size of the destination? What would happen if you did: 1. addw (%r8) %rax. Would it add one byte, two bytes, three bytes? Interpreted as signed or unsigned? 2. Say $eax = 0x0000FFFF. What would the result [...] read more
assembly
x86-64
att
0votes
1answer

How to get a PWM signal on port D6 (PE_9) on a STM board?

I'm programming a board and want a PWM signal to appear on a pin to drive a LED. I'm using a STM32 NUCLEO-F207ZG board, and only low-level register programming. It is not working. I've looked into the manual, datasheet and application note. Also some Google searches have been done. //Enable [...] read more
c
timer
stm32
pwm
nucleo
0votes
1answer

How to perform division on two 32Q16 fixed-point integers?

I am trying to divide two 32Q16 numbers using fixed-point processing arithmetic. What I understand is that when we divide one 32Q16 fixed-point operand by another, we require the result to be a 32Q16 number. We, therefore, need a 64Q32 dividend, which is created by sign extending the original 32Q16 [...] read more
c
bit-shift
fixed-point
0votes
0answers

How to make TAP adapter accept all traffic form PC?

I'm developing a client application to capture traffic on a PC. I'm using OpenVpn tun/tap adapter. But it dosen't work, when I'm testing application traffic goes through Wireless LAN adapter. How to make all traffic go through tun/tap adapter? DWORD active = 1; DWORD len; int status = DeviceIoControl(handle, TAP_CONTROL_CODE(6, [...] read more
networking
openvpn
0votes
0answers

Code to replace CRC32 included in existing library

I'm trying to CRC32 with STM32L151. I wrote the code with an existing library. But I don't want to use the CRC32 code included in the existing library. I want to create my own. How can I derive the correct code from this code? I didn't look up the CRC32 [...] read more
stm32
crc32
0votes
1answer

Sound player can't read WAV file produced by my program, says missing header

I am coding a program that renders a wave type (sine, square, wavetooth, etc.) and writes it to a file. The problem is that sound player says the header is missing even though I wrote it. The data types are supposed to be written in little endian. I tried re-writing [...] read more
c
type-conversion
binaryfiles
0votes
1answer

Execution failed for task ':app:packageRelease'. value (90354) > 0x0000ffff

When building a Cordova Android app, I get the following error. The error occurs when running cordova build android, and cordova build android --release, and cordova run android. > Task :app:packageRelease > Task :app:packageRelease FAILED 42 actionable tasks: 42 executed FAILURE: Build failed with an exception. * What went wrong: [...] read more
android
cordova
0votes
1answer

Putting core 0 in non-secure world

I am using a custom board, having zynq-7000. I am running two application on both cores. I want to put cpu0 in non-secure world and cpu1 in secure world. As Cpu1 is already in secure world, I am trying to make Cpu0 in non-secure world. I am trying to put [...] read more
linux-kernel
arm
zynq
trust-zone
0votes
0answers

SDL_UpdateTexture ARGB much faster than RGBA

I was trying to use SDL_UpdateTexture to create a texture from an allocated buffer of pixels, and I was surprised that it wasn't even rendering at 60fps (with the main culprit being SDL_UpdateTexture): #include <SDL2/SDL.h> #include <sys/time.h> static double time_in_ms(void) { struct timeval tv; gettimeofday(&tv, NULL); return tv.tv_sec * 1000.0 [...] read more
c
sdl-2
rgba
argb
0votes
0answers

Linking C, C++ and assembly

I'm writing little "kernel" that displays "Hello world!" on the screen. I have working putc (put char) function so I can do it (and I did it) with 12 putc function calls but I want do it with puts (put string) function and I want to write it in C++. [...] read more
c
assembly
vga
0votes
0answers

Is this a GCC bug or am I doing something wrong?

I am trying to get the final accumulate in the code below to use the ARM M7 SMLAL 32*32->64 bit accumulate function. If I include the T3 = T3 + 1 than it does use this, but if I comment it out it does a full 64*64 bit and accumulate [...] read more
gcc
arm
0votes
2answers

Dart: split an arbitrarily precised number onto a sequence of bytes

Assuming I have a declaration like this: final int input = 0xA55AA9D2;, I'd like to get a list of [0xA5, 0x5A, 0xA9, 0xD2]. It is easily achievable in Java by just right shifting the input by 24, 16, 8 and 0 respectively with subsequent cast to byte in order to [...] read more
dart
0votes
1answer

How to obtain the Least-significant bits of a number

I wonder if it's possible to obtain the Least-significant bits of a number. Example : uint intValue = Int32.MaxValue; uint LSB = intValue & 0x0000FFFF; from : https://www.oreilly.com/library/view/c-cookbook/0596003390/ch01s06.html but I need this in VB.net. I tried : Dim intValue As UInteger = 39101 Dim LSB As UInteger = intValue And [...] read more
.net
vb.net
hex
0votes
0answers

Metal alpha channel oddity

I'm trying to render to a MTLTexture within an MTKView and then pull the entire region back off the GPU and have an alpha pixel values of clear RGBA=0x00000000 really come off the GPU as just that -- in those regions where I haven't drawn anything. Instead, all un-rendered areas [...] read more
metal
metalkit
0votes
1answer

Using a string with libusb causes segmentation fault

I'm using netbeans with gcc to compile. When I run the attached code, I get the error: RUN FINISHED; Segmentation fault; core dumped; real time: 310ms; user: 40ms; system: 10ms If 'char stringData' is commented out, there is no segmentation fault. Also, if libusb_get_device_descriptor is removed (and accompanying struct references), [...] read more
c
string
libusb
0votes
0answers

AndroidWifiModule.java uses o r overrides a deprecated API

I downloaded react-native-android-wifi modules but when I run the code it says AndroidWifiModule.java uses o r overrides a deprecated API. Also its cannot connect to a network in android 8, so I added this line //conf.SSID = String.format("\"%s\"", ssid); if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { conf.SSID = ssid; } else { [...] read more
java
android
android-studio
react-native
react-native-android
0votes
1answer

Getting 16 least and most significant bits of an arbitrary length binary number

So the problem I am having is obtaining the least significant and most significant 16 bits of a number over 16 bits but not necessarily of any certain length. If the number was an int which is 32 bits I believe I could just do something like: int Num=0xFFFFFFFF short [...] read more
java
bit-manipulation
bit
0votes
1answer

Read a list of strings from text file and remove the extra quotes

In my text file, I have a list of strings as follows : ['', '"0=SYSEV,1=APPEV,2:3=VECEV"', '"ASEN"+$y', '"FALSE"', '"G"+$x+"ARBCFG"', '"G"+$x+"ARBPR"', '"HUGO:SECURE"', '"Internal"', '"SERIAL0:TRANSMIT"', '$fpi_mem_range', '$fpi_to_sri_base', '$fpi_to_sri_range', '$sx_fpi_base', '$sx_fpi_range', '$sx_sri_dest', '$trignum_g-1', '$x!=0', '$x!=1', '$x==1', '0', '0x0', '0x00', '0x0000', '0x00000000', '0x00000FFFF', '0x0000FFFF', '0x0D', '0x10', '0x1000', '0x10000000', '0x11001111', '0x11111100', '0xffc', '0xffffffff', '1', '1 clock [...] read more
python
list
parsing
text
0votes
0answers

understand the operation of LB MIPS

LB MIPS operation : link : http://www.ece.cmu.edu/~ece447/s13/lib/exe/fetch.php?media=mips_r4000_users_manual.pdf Page 549 32 vAddr ← ((offset15)16 || offset15...0) + GPR[base] (pAddr, uncached) ← AddressTranslation (vAddr, DATA) pAddr ← pAddrPSIZE – 1 ... 3 || (pAddr2...0 xor ReverseEndian3) mem ← LoadMemory (uncached, BYTE, pAddr, vAddr, DATA) byte ← vAddr2...0 xor BigEndianCPU3 GPR[rt] ← (mem7+8*byte)24 [...] read more
assembly
mips
cpu-architecture
machine-code
0votes
1answer

C++ Depth Buffer Oculus Rift DK2 VR HMD

This is a question for anybody experienced with the Oculus Rift C++ SDK. -------------------------------------------------------------------------------- SDK Version: ovr_sdk_win_1.20.0_public IDE: VS2013 -------------------------------------------------------------------------------- I am trying to resolve a depth buffer problem in my code for a simplified 3D engine for the Oculus Rift DK2. The OculusRoomTiny example supplied with the SDK is [...] read more
c++
buffer
directx-11
depth
oculus
0votes
0answers

Cannot receive window message from child popup - Winforms

I created Scintilla Popup for textbox to show autocomplete : this.hWnd = CreateWindowEx( 0, "Scintilla", "", WS_CHILD | WS_VISIBLE | WS_TABSTOP | WS_CLIPCHILDREN | 0x00002000, x, y, textbox1.ClientSize.Width, textbox1.ClientSize.Height, textbox1.Handle, (IntPtr)0, (IntPtr)0, (IntPtr)0); and in custom textbox, i overriden WndProc : protected override void WndProc(ref Message m) { } I [...] read more
c#
winforms
0votes
2answers

Why xor() does not work on openwrt

We are porting openwrt to our device which is a mips platform. But we found the service "dnsmasq" can't be started correctly on our device. Then we found the root cause, "/etc/init.d/dnsmasq" used the script "/bin/ipcalc.sh" generating the wrong configuration for "dnsmasq" and "dnsmasq" failed to parse the configuration. Here [...] read more
awk
xor
openwrt
dnsmasq
0votes
1answer

Stepper Motor won't stop rotating

I'm trying to get my 28BYJ-48 Stepper Motor to rotate one quarter of a revolution and then stop, but I'm having trouble implementing that in code. What I find is no matter how small I make the numbers in my code or even alter it in ways that make me [...] read more
c
syntax
microcontroller
keil
stepper
-1votes
1answer

Is there a better way to mask bits?

So I am trying to split memory addresses into their page number and offset components by masking the hex numbers. But to cover a decent variety of addresses of different bits and page sizes, I seem to have to write a lot of nested if else statements. Right now, I [...] read more
c
memory-address
bitmask
-1votes
1answer

Why is the binary shift required when extracting lo and hi words from a DWORD?

First off sorry about the title, I didn't want to make it too long or confusing. If someone can help me make it more general as this situation probably applies to any kind of bit mask operation. [The following code is run in Windows (so it's little endian)] If I [...] read more
c++
c
-1votes
1answer

How do I convert this PowerShell code to C#

I need to convert this piece of code to C# and I am not familiar with PowerShell script to understand what this is doing and then write it in C#. It is basically taking an integer and returning a corresponding tag. I tried to write it myself but just did [...] read more
c#
-2votes
3answers

UNDERSTANDING how to count trailing zeros for a number using bitwise operators in C

Note - This is NOT a duplicate of this question - Count the consecutive zero bits (trailing) on the right in parallel: an explanation? . The linked question has a different context, it only asks the purpose of signed() being use. DO NOT mark this question as duplicate. I've been [...] read more
c
hex
bit-manipulation
bit-shift
-3votes
1answer

Fixed Point number 4 bytes or 8 bytes with different scale factors - library to convert numbers?

I have to read fixed point numbers either 4 bytes or 8 bytes and the location of the decimal moves for each item (a known location)(scale number) Is there a library where this is automated? C/C++ is the language of choice For Example: This is assuming a scale of 20 [...] read more
c++
c
bit-manipulation
fixed-point
-8votes
2answers

Understanding problem in bitwise operator in C

Here x is any decimal number. What does this expression mean? return ( (x & 0x0000FFFF)<<16 | (x & 0xFFFF0000)>>16 ); read more
c

Comments

Leave a comment

(plain text only)

Sources

  1. https://msdn.microsoft.com/en-us/library/cc231198.aspx
  2. winerror.h from Windows SDK 10.0.14393.0

User contributions licensed under CC BY-SA 3.0